I am working with a library that performs an operation (I think with LINQ) in a function and returns a collection of objects like this:
System.Collections.Generic.IEnumerable<ColorInformation>
this “ColorInformation” is a class that looks like this:
public class ColorInformation
{
private readonly System.Drawing.Color color;
private readonly string rowTitle;
private readonly System.Collections.Generic.List<int> ids;
public ColorInformation(System.Drawing.Color color, string rowTitle,
System.Collections.Generic.List<int> ids)
{
this.color = color;
this.rowTitle = rowTitle;
this.ids = ids;
}
public string RowTitle
{
get { return rowTitle; }
}
public System.Drawing.Color Color
{
get { return color; }
}
public System.Collections.Generic.List<int> Ids
{
get { return ids; }
}
}
I am interested in retrieving ALL the ids of ALL the objects in the collection returned. I have tried this:
var myids = from ids in theCollectionReturned select ids.Ids;
That gives me a Collection of Lists with the ids. What I actually want is just one list with ALL the integer ids in it. So, there has to be a cast or some conversion somewhere and I am not sure how to do that. Any help, tips, readings, code, examples would be appreciated.
Thanks!
It sounds like you want: