Archive for May 21st, 2012

LINQ: List of Lists to flattern

May 21, 2012

Lots of code contains list of lists or dictionary of lists data objects.
Quite often we need to extract a flattern list of data.

The simplest linq staments is

var flatterList = from el in externalList
                  from il in el.innerList
                  select el.code, el.description, il.subcode, il.detailA;

For a complete list of samples, read Use LINQ’s SelectMany Method to “Flatten” Collections .

source: Use LINQ’s SelectMany Method to “Flatten” Collections

Technorati tags: LINQ
  • May 2012
    M T W T F S S
    « Apr   Jun »
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • .

    .Net Agile Antivirus Book C# Programming EntityFramework GTD Hyper-V LinQ MVVM Office Resharper SCRUM Security Sharepoint Silverlight SQLServer TFS ToDoList Unit Test VirtualBox Virtual PC Visual Studio VMware Windows7 WPF XeDotNet XML XPath

  • Follow

    Get every new post delivered to your Inbox.