The following code seems to add a new record to the list but overwrites all the record with the last record created. I can get it to work fine with ...
lpr.Add(n
Possible duplicate of what is different between Passing by value and Passing by reference using C#.
But as pr
is a class this means that when you are adding it to the list you are actually only storing the reference to that variable. When you change that variable the next 3 times what you are actually changing is the values located at the memory of the original reference. So your list actually contains 4 references to the same object with the same values.
If you are attempting to reuse the same object (as this may be a model for your view) you should make a new object with it's values and add this new object to your list.