Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

linq cheat sheet

var query = from m in Models
		join p in PartNumbers on m.ModelId equals p.ModelId
		where m.Name.Contains("Domane")
		select new {m.ModelId, ModelName = m.Name, PartNumber = p.InventoryPartNumber };

var lambda = Models.Join(PartNumbers, m => m.ModelId, p => p.ModelId, (m, p) => new {m = m, p = p} )
					.Where( j => j.m.Name.Contains("Domane"))
					.Select(j => new {ModelId = j.m.ModelId, ModelName = j.m.Name, PartNumber = j.p.InventoryPartNumber});
Source by brianvanderplaats.com #
 
PREVIOUS NEXT
Tagged: #linq #cheat #sheet
ADD COMMENT
Topic
Name
8+2 =