background preloader

LINQ

Facebook Twitter

Linq.

LINQ to SQL

Categories. Basic LINQ Query Operations. In a LINQ query, the first step is to specify the data source.

Basic LINQ Query Operations

In C# as in most programming languages a variable must be declared before it can be used. In a LINQ query, the from clause comes first in order to introduce the data source (customers) and the range variable (cust). //queryAllCustomers is an IEnumerable<Customer> var queryAllCustomers = from cust in customers select cust; The range variable is like the iteration variable in a foreach loop except that no actual iteration occurs in a query expression.