实体框架VS LINQ到SQL [英] Entity Framework vs LINQ to SQL

查看:138
本文介绍了实体框架VS LINQ到SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在的.NET版本3.5 SP1已经发布(与VS2008 SP1),我们现在可以访问.NET实体框架。

Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the .NET entity framework.

我的问题是这样的。当试图使用实体框架和LINQ to SQL作为一个ORM的决定,有什么区别?

My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference?

我的理解是,实体框架(使用LINQ到实体使用时)是个'大哥哥'来的LINQ to SQL?如果是这样的话 - 它有什么优势?它能做什么的LINQ到SQL不能对自己做的?

The way I understand it, the Entity Framework (when used with LINQ to Entities) is a 'big brother' to LINQ to SQL? If this is the case - what advantages does it have? What can it do that LINQ to SQL can't do on its own?

推荐答案

的LINQ to SQL只支持数据库表,视图,存储过程和函数在Microsoft SQL Server提供了1对1的映射。这是一个伟大的API,以用于快速访问数据结构相对精心设计的SQL Server数据库。 LINQ2SQL首次发布了与C#3.0和.NET Framework 3.5。

LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.

LINQ到实体(ADO.Net Entity Framework的)是一个ORM(对象关系映射器)API,它允许对象领域模型的广泛定义和他们的许多不同的ADO.Net数据提供者的关系。因此,你可以混合和匹配多个不同的数据库供应商,应用程序服务器或协议来设计聚合混搭它们从各种表格,来源,服务等的ADO.Net框架与发布构建的对象在.net Framework 3.5 SP1。

LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.

这是MSDN上的一个很好的介绍性文章: 介绍LINQ到关系数据

This is a good introductory article on MSDN: Introducing LINQ to Relational Data

这篇关于实体框架VS LINQ到SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆