您的位置:首页 > Web前端

What is the difference between LINQ to SQL and LINQ to Entities?

2011-08-03 06:51 549 查看
The ability to query relational stores other than the Microsoft SQL Server family of products.

What is LINQ?

Microsoft’s new Language Integrated Query (LINQ) is a set of extensions to the .NET Framework that provide common capabilities within the programming language for querying against in-memory data as well as external data sources. LINQ complements our vision for an Entity Data Platform by providing language extensions for querying data as objects within the programming language.

Relations between LINQ & Entity Framework?

The ADO.NET Entity Framework will fully support LINQ through a feature known as “LINQ to Entities”. LINQ to Entities combines the developer experience of having query integrated into the programming language and the richness of being able to define an Entity Data Model with flexible mapping to relational stores.

What is the difference?

LINQ to SQL supports rapid development of applications that query Microsoft SQL Server databases using objects that map directly to SQL Server schemas. LINQ to Entities supports more flexible mapping of objects to Microsoft SQL Server and other relational databases through extended ADO.NET Data Providers.

If you are writing an application that requires any of the following features, you should use the ADO.NET Entity Framework:

The ability to define more flexible mapping to existing relational schema, for example:
Mapping a single class to multiple tables

Mapping to different types of inheritance

Directly Modeling Many to Many relationships

Mapping to an arbitrary query against the store

The ability to share a model across Replication, Reporting Services, BI, Integration Services, etc.

A full textual query language

The ability to query a conceptual model without materializing results as objects

If you do not require any of these features, LINQ to SQL may provide a simpler solution for rapid development. LINQ to SQL is targeted at rapid-development scenarios against Microsoft SQL Server and provides a simpler approach and richer design experience in the Orcas timeframe for applications with data classes that map directly to the schema of your Microsoft SQL Server database.

Microsoft is defining a migration plan for customers that start with LINQ to SQL and require additional functionality, such as richer mapping capabilities or access to other stores, to migrate to the ADO.NET Entity Framework.


LINQ to SQL supports rapid development of applications that query Microsoft SQL Server databases using objects that map directly to SQL Server schemas.

LINQ to Entities supports more flexible mapping of objects to Microsoft SQL Server and other relational databases through extended ADO.NET Data Providers

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐