I need to return a list within a list using linq(lambda), however, still not getting required syntax.
I have a list of WikiMeta which I want to query and return all the WikiGroups as a new list.
Note: Some properties have been removed from clarity.
List<WikiMeta> Meta;
public class WikiMeta
{
public List<WikiGroup> Groups = new List<WikiGroup>();
}
public class WikiGroup
{
public string Name { get; set; }
}
List<T>? You can useWhereSelectMany, like:Meta.SelectMany(m => m.Groups);