Osco.se

A notebook

Is also seen at MSDN

Main menu

Skip to primary content
Skip to secondary content
  • Home

Monthly Archives: February 2016

Linq select many from list and keep id

Posted on February 29, 2016 by osco.se
Reply

This example applies to if you want to select the id from class A and all flatten list elements from “ListB”:

public class A
{
int Id {get; set;}
List ListB {get; set;}
}

var _listItems = (from x in _orgList
.SelectMany(x => x.ListObjects, (Product, Param) =>
new { Product, Param })
select new { }

Posted in Programmering | Tagged flatten, linq, select many | Leave a reply

Tidigare

  • January 2018 (1)
  • December 2017 (1)
  • October 2017 (1)
  • September 2017 (1)
  • August 2017 (2)
  • March 2017 (1)
  • January 2017 (1)
  • December 2016 (1)
  • October 2016 (1)
  • August 2016 (2)
  • June 2016 (2)
  • May 2016 (2)
  • April 2016 (2)
  • March 2016 (1)
  • February 2016 (1)
  • January 2016 (1)
  • December 2015 (1)
  • November 2015 (2)
  • September 2015 (2)
  • June 2015 (1)
  • May 2015 (1)
  • April 2015 (2)
  • March 2015 (1)
  • January 2015 (1)
  • November 2014 (2)
  • October 2014 (1)
  • May 2014 (1)
  • November 2013 (1)
  • September 2013 (1)
  • July 2013 (3)
  • February 2013 (1)
  • January 2013 (2)
  • March 2012 (2)
  • February 2012 (1)

Tags

2017 asp.net australian open autocomplete connect controls cordova css customize database entity ergonomi exekveringstid failed federer final font framework färg grand slam högerklick iis jQuery krasch linq loop model mvc performance phonegap projekt query rack shell view spel sql tema tennis tetris utveckling virtual clonedrive visual studio vs2010 windows windows forms

Recent Comments

  • Oscar on Lines between braces in Visual Studio 2017
  • Jon von Gillern on Lines between braces in Visual Studio 2017

Recent Posts

  • Use only Swedish servers in tor browser
  • Unable to launch the IIS Express Web server
  • Export PFX file from CRT/CER/P7B
  • Could not load file or assembly System.Web.WebPages.Razor
  • Failed to Execute URL ASP.net
Osco.se © 2016