LINQ is a set of features introduced in the .NET Framework version 3.5 that bridges the gap between the world of objects and the world of data.
Traditionally, queries against data are expressed as simple strings without type checking at compile time or IntelliSense support. Furthermore, you have to learn a different query language for each type of data source: SQL databases, XML documents, various Web services, and so on. LINQ makes a query a first-class language construct in C# and Visual Basic. You write queries against strongly typed collections of objects by using language keywords and familiar operators.
Linq queries are written using the Standard Query Operators (which are a set of extension methods that operates mainly on objects of type IEnumerable<T>
and IQueryable<T>
) or using Query Expressions (which at compile time, are converted to Standard Query Operator method calls).
Query operators provide query capabilities including filtering, projection, aggregation, sorting and more.