linq与sql和实体框架之间的区别 [英] difference between linq to sql and entity framework
问题描述
实体框架与LINQ to SQL
但是在这里我正在用EF和Linq向Sql询问,我们先创建实体,然后生成表或者另一种方法,以及这两种方法的积极和否定。
在EF中,可以存在从多个表继承的任何业务实体,并不表示DB中的任何事物。
Linq与不同于EF的实体?
如果问题不清楚或错误询问,请通知我。先谢谢你们。
对于生产版本,EF& L2S要求在生成任何类之前建立一个数据模型(读取:数据库模式)。首先创建您的类,然后从中生成DB的功能可以以EF4 CTP的形式提供,这些格式可以使用 ScottGu博客。
只要单个实体反映多个表:我相信当前是一对一的关系:1 table = 1 Entity。
There are lof of difference between Linq to Sql and Entity framework like Linq to SQL is one to one mapping and EF is many to many mapping and many other which can be found at Entity Framework vs LINQ to SQL
But here I am asking with EF and Linq to Sql, do we create Entities first and then generate tables or the other way and what are positives and negatives of both the approaches. In EF could there be any business entities which are inherited form multiple tables and does not represent any thing in the DB. Is Linq to Entities different from EF?
Please let me know if question is not clear or wrongly asked. Thanks in advance guys.
For "production" releases, both EF & L2S require that a data model (read: Database schema) be in place before any classes can be generated. The ability to create your classes first and then generate the DB from that is available in the form of the EF4 CTP that ScottGu blogged about recently.
As far as a single Entity reflecting multiple tables: I believe that is currently a one-to-one relationship: 1 table = 1 Entity.
这篇关于linq与sql和实体框架之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!