I don't understand why you're using a
List<List<baplieContainerDO>>
, doesn't quite make sense since you're only ever adding one item to that nested list. But according to your question:
first data is being tampered
This is because you create your
oBaplieContainerDO
object only once and then you store it against the class in a field. Then later when in your loop you're updating the
same object instance over and over:
oBaplieContainerDO.stowageCell = i.ToString();
oBaplieContainerDO.freeText = i.ToString();
oBaplieContainerDO.containerNumber = i.ToString();
You need to create a new instance of this class in each loop instead of updating the existing object, that's why all of the elements in the list are being updated to the same values.