I have an object:
public class DataItem
{
public string Location
{
get;
set;
}
public List<string> PersonList
{
get;
set;
}
}
I have some results from a table that return something like:
Room1 John
Room1 Jim
Room1 Dawn
Room1 Bob
Room1 Katie
I have some LINQ that I've written:
var grouped = from table in sqlResults.AsEnumerable()
group table by new { placeCol = table["LOCATION"] } into groupby
select new
{
Value = groupby.Key,
ColumnValues = groupby
};
Which groups my results... But I'd like to put this into my object (DataItem). I've seen a couple of examples but nothing has worked... What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…