I have a statement like this =
var result =
from c in displayedUsers
select
new string[]
{
c.GetType().GetProperty(columnList[0]).GetValue(c, null).ToString(),
c.GetType().GetProperty(columnList[1]).GetValue(c, null).ToString(),
c.GetType().GetProperty(columnList[2]).GetValue(c, null).ToString(),
c.GetType().GetProperty(columnList[3]).GetValue(c, null).ToString()
};
What I want to know is if it's possible to not have to have a static list length (in this case you can see there are only 4 items)
How would I do this if I had N number of columns in the 'columnList' array?
Something along the lines of =
var result =
from c in displayedUsers
select
new string[]
{
foreach item in columnList GetValue
...
};
Thanks!