Language Integrated Query (LINQ),
Language Integrated Query (LINQ), is a component released within the .NET 3.5 Framework. It is one of the most powerful features of .NET 3.5. It serves the purpose of querying objects.
LINQ comprises a series of operators, which are used to query, filter and project data in arrays, enumerable classes, relational databases and XML. In order to query data in LINQ, the data needs to be encapsulated as an object. In case the data source is not an object, it first needs to be converted to an object in order for LINQ to query it.
LINQ has its own Query Processing Engine. The information returned by a LINQ query is a collection of in-memory object which may be enumerated.
The LINQ concept treats the data source as an object, rather than a database. So we may say, its an object that is queried. LINQ may query any type of data source, like:
- LINQ querying SQL
- LINQ querying Datasets (also DataTables)
- LINQ querying ORM Solution
- LINQ querying Objects (In-memory data may be queried)
- LING querying XML (Querying is possible on XML data source)
LINQ supports querying to those objects that implements the IEnumerable Interface.
DataContext class represents the main entry point for the LINQ to SQL framework.
The file extension for LINQ to SQL is .dbml
Note: System.Linq namespace needs to be used for implementing LINQ.