Monday, November 28, 2011

LINQ - Language Integrated Query

LINQ is a programming model that introduces queries as a first-class concept into any Microsoft .NET language. It allows you to write structured type-safe queries over local object collections and remote data sources. However, complete support for LINQ requires some extensions in the language used. These extensions boost productivity, thereby providing a shorter, meaningful, and expressive syntax to manipulate data.
The LINQ language extensions use the new Standard Query Operators API, which is the query language for any collection that implements IEnumerable<t>. It means that all collections and arrays can be queried using LINQ. The collections classes simply needs to implement IEnumerable<t>, to enable it for LINQ to query the collections. LINQ is a technology that covers many data domains. Some of these domains are included in those “LINQ Flavors” that Microsoft provides as part of the .NET 3.5 Framework, as shown in figure below:

LINQ to Objects
LINQ to Objects has the goal of manipulating collections of objects, which can be related to each other to form a hierarchy or a graph. From a certain point of view, LINQ to Objects is the default implementation used by a LINQ query.
LINQ to ADO.NET includes different LINQ implementations that share the need to manipulate relational data. It includes other technologies that are specific to each particular persistence layer:
  • LINQ to SQL Handles the mapping between custom types in C# and the physical table schema.
  • LINQ to Entities Is in many ways similar to LINQ to SQL. However, instead of using the physical database as a persistence layer, it uses a conceptual Entity Data Model (EDM). The result is an abstraction layer that is independent from the physical data layer.
  • LINQ to DataSet Makes it possible to query a DataSet using LINQ.
LINQ to XML offers a slightly different syntax that operates on XML data, allowing query and data manipulation. It provides the in-memory document modification capabilities of the Document Object Model and supports LINQ queries.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.