Work on C# linq.I have a list to list.From this list I want to get the common items
List<SQLFrameWorkTableEntity> oParent = new List<SQLFrameWorkTableEntity>();
List<List<SQLFrameWorkTableEntity>> oChild = new List<List<SQLFrameWorkTableEntity>>();
oListParentTable = oList.Where(p => p.Parent == true).ToList();
foreach (SQLFrameWorkEntity item in oListParentTable)
{
oChild.Add(GetTableSchemaList(item, oParent));
}
Above picture describe how my oChild is.
Now this oChild is the list of list SQLFrameWorkTableEntity.I want to get the common items from the oChild.How to get it?If have any query plz ask.Thanks in advance
After replace List to List> ,I write the bellow linq syntax
var r=oChild.Select(p => p.Select(x => p.Any(y => y.ColumnName == x.ColumnName))).ToList();
Here, in r i get all list item are true,that means i fail to compare with list to list.Help me to correction this syntax.Thanks
>` or something similar? It's not really clear what you mean.
– Jon Skeet Nov 05 '11 at 20:04>.Thanks ,I change my syntax .Now will you plz tell me how to get the common items from the list of list.thanks again
– shamim Nov 05 '11 at 20:10