Monday, 14 July 2014

Select clause comes after from clause in LINQ.



Select clause comes after from clause in LINQ.

The reason behind it is LINQ is used with C# or other programming languages, which requires all the variables to be declared first. From clause of LINQ query just defines the range or conditions to select records. So that’s why from clause must appear before Select in LINQ.

For Example:

var queryEmp = from emp in employees where emp.City == "India" select emp;

No comments:

Post a Comment