Easy Step to LINQ understand in C#
Linq queries for beginners Following are some of the basic Linq command/samples for those who just want to start learning Linq. So this will help a lot to all the beginners to easily understand Linq queries. // Basic Query // To achieve Select * From ProductMst you need to write follofing linq Query var Result1 = from p in db.ProductMst select p; // To achieve Select ProductID, ProductName, Price From ProductMst you need to write follofing linq Query var Result2 = from p in db.ProductMst select new { p.ProductID, p.ProductName, p.Price }; // Where Clause Query // To achieve Select * From ProductMst Where ProductID = 1 you need to write follofing linq Query var Result3 = from p in db.ProductMst where p.ProductID == 1 select p; // To achieve Select * From ProductMst Where SupplierId =2 and Price > 10 you need to write follofing linq Query var Result4 = from p in db.ProductMst where p.SupplierID == 2 && p.Price > 10 ...