Why LINQ?
- Increases productivity compared to using ADO.NET
- SQL has many vendor-specific dialects and data types.
- Integration with C# and VB. Syntax of the LINQ query would remain similar when query against different data sources, such as
- Database
- XML
- Parametrization is automatic and type-safe.
- Extensive IntelliSense support / Debugger support
- Strongly typed queries - compile-time checking for all queries.
- Not just for queries
- It is a data iteration engine
- Asynchronous Programming using LINQ Syntax
Current version of LINQ to SQL
- LINQ to SQL works only with SQL Server
- Does not directly support CTEs and FullText search
- Targeted for Rapid Development - 1:1 relationship between table and object
The Entity Framework
- Support more database engines than just SQL Server
- LINQ to entities is more "enterprise" targeted
- You can map a single class to multiple tables, or map multiple classes to the same table.
Other Usage
References:
LINQ to SQL vs LINQ to Entities, where should we spend our time?