I have Collection:
public class Test
{
public double Index { set; get; }
public double A { set; get; }
public double B { set; get; }
public double C { set; get; }
}
List<Test> test = new List<Test>();
I filled A and B with some random numbers. After that, I want add items C in collection. For example, what I trying:
foreach (Test t in test)
{
c = t.A + t.B;
test.Add(new Test {C = c }); <------
}
How can I add element C on same position like A and B? (Sorry for my english)