I need to update value in each element of a list in C# of VS2013.
The code:
var wl = myList.ToArray();
List<myElement> tl = new List<myElement>();
tl = givenList; // I need to update values in element in this list
for(int p =0; p < wl.Count(); ++p)
{
decimal? fv = (wl[p].value * 10) / ((decimal?)a_constant);
tl.ToArray()[p].value = fv; // this cannot update the value
}
myList = tl;
But, the tl.ToArray()[p].value = fv; does not update the value.
Any help would be appreciated.