Build and host your website with us as easy as you like.

Thursday, November 15, 2007

The power of LINQ

LINQ has become bit of a buzz word among C# & VB.NET developers around the world with the pre-release of VS2008. So I too couldn't resist going after it to figure out how it's going to revolutionize C# 3.0 & VB 9.

LINQ stands for Language Integrated QUery and fundamentally is about integrating query operations into the .NET platform in a comprehensive and open manner. It's also about providing a unified way to query across any kind of data, despite of the data sources being relational, objects or XML.
LINQ has three major components:
  • LINQ to Objects
  • LINQ to ADO.NET, which includes LINQ to DataSet (originally called LINQ over DataSet), LINQ to Entities & LINQ to SQL (originally called DLinq)
  • LINQ to XML (originally called XLinq)

LINQ to Objects deals with in-memory data. Any class that implements the IEnumerable interface (in the System.Collections.Generic namespace) can be queried with LINQ’s standard query operators (SQO), which are implemented as methods in class Sequence in the System.Query namespace.

LINQ to ADO.NET deals with data from external sources, basically anything ADO.NET can connect to Any class that implements IEnumerable or IQueryable (in the System.Query namespace) can be queried with LINQ’s standard query operators (SQO), which are implemented as methods in class Sequence in the System.Query namespace.

LINQ to XML is a comprehensive API for in-memory XML programming. Like the rest of LINQ, it includes SQO, and it can also be used in concert with LINQ to ADO.NET, but its primary purpose is to unify and simplify the kinds of things that disparate XML tools, like XQuery, XPath, and XSLT, are typically used to do.

No comments: