Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Language Integrated Query, or LINQ for short (pronounced “link”), is a set of Microsoft .NET Framework language enhancements and libraries built by Microsoft to make working with data (for example, a collection of in-memory objects, rows from a database table, or elements in an XML file) simpler and more intuitive. LINQ provides a layer of programming abstraction between .NET languages and an ever-growing number of underlying data sources.
Why is this so inviting to developers? In general, although there are many existing programming interfaces to access and manipulate different sources of data, many of these interfaces use a specific language or syntax of their own. If applications access and manipulate data (as most do), LINQ allows developers to query data using similar C# (or Visual Basic.NET [VB.NET]) language syntax independent of the source of that data. This means that whereas today different languages are used when querying data from different sources (Transact-SQL for Microsoft SQL Server development, XPath or XQuery for XML data, and code nested for/if statements when querying in-memory collections), LINQ allows you to use C# (or VB.Net) in a consistent type-safe and compile-time syntax checked way.