Answers for "c# linq cheat sheet"

SQL
0

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});
Posted by: Guest on October-06-2020
0

linq cheat sheet

Dim query = from m in Manufacturers
	where m.Name = "Trek" 
	select m

Dim lambda = Manufacturers.Where(function(m) m.Name = "Trek").Select(function(m) m)
Posted by: Guest on October-06-2020
0

linq cheat sheet

Dim query = from m in Manufacturers
	where m.Name = "Trek" 
	select new with {.Name = m.Name, .ManufacturerId = m.ManufacturerId}

Dim lambda = Manufacturers.Where(function(m) m.Name = "Trek").Select(function(m) new with {.Name = m.Name, .ManufacturerId = m.ManufacturerId})
Posted by: Guest on October-06-2020
0

linq cheat sheet

var query = from m in Manufacturers
	where m.Name == "Trek" 
	select m;

var lambda = Manufacturers.Where(m => m.Name == "Trek").Select(m => m);
Posted by: Guest on October-06-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language