Dynamically, I would like to take a string property like "GPARank" and change the value of it.
normally, I would have
var rank = gpa.ForEach(x => x.GPARank = i);
But in this case, I don't know which property I am changing at compile time. I tried to modify Marc Gravell's code at Dynamic LINQ OrderBy on IEnumerable<T> for my uses, but my brain exploded.
Thanks!
Figured out using reflection, still want a dynamic linq expressions solution
gpa.ForEach(x => x.GetType().GetProperty(_ColumnRank).SetValue(x, i += 1 , null));
I was able to figure out how to do this using reflection. But if anyone has the time or desire to show me how to do this using dynamic linq with run-time expressions, I would really like to know how to do this.