i have a list
public class Org
{
public string Name;
public List<OrgPost> OrgPostCollection= new List<OrgPost>();
}
public class OrgPost
{
public string OrgPostTitle;
}
and have:
List<Org> OrgCollection=//GetAll(Org);
and now i have a list of org like this
[Name,OrgPostCollection]
[Name2,OrgPostCollection2]
...
but i need something like this:
[Name1,OrgPostCollection[0]]
[Name1,OrgPostCollection[1]
[Name2,OrgPostCollection[0]]
[Name2,OrgPostCollection[1]]
...
You can do a nested select:
You can then project whatever you want in the
select, I project aTuple<Org, OrgPost>.The result
flatEnumerableisIEnumerable<Tuple<Org, OrgPost>>, you can then callToListorToArrayto resolve the enumerable into a list or array: