LinQ: Add list to a list

Posted by JohannesBoersma on Stack Overflow See other posts from Stack Overflow or by JohannesBoersma
Published on 2010-06-07T07:33:22Z Indexed on 2010/06/07 7:42 UTC
Read the original article Hit count: 256

Filed under:
|
|

I have the following code:

var columnNames = (from autoExport in dataContext.AutoExports
               where autoExport.AutoExportTemplate != null
                  && ContainsColumn(autoExport.AutoExportTemplate, realName)
               select GetDbColumnNames(autoExport.AutoExportTemplate, realName)).ToList();

Where the function GetDbColumns() returns an List<string>. So columNames is of the type List<List<string>>. Is it possible to create a List<string>, so each element of the list of GetDbColumns is added to the result of the LinQ query?

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-sql