English 中文(简体)
每种模板类型的预期用途、优点和缺点是什么?
原标题:What are each of the template types intended usage, pros and cons?

我几乎没有接触过EF4,但我已经用了很多Linq来sql了。我想从EF模板中的一个开始,但我不知道什么情况对每个模板都有意义,也不知道它们的意图是什么。

我有以下可能性:

  • Data templates
    • ADO.NET Entity Data Model
    • Service-based Database (is this even related to EF?
  • Code templates (I am familiar with T4)
    • ADO.NET EntityObject Generator
    • ADO.NET Self-Tracking Entity Generator
  • Online Templates
    • ADO.NET C# POCO Entity Generator
最佳回答

I have no idea what situations make sense for each or what their intent was

这并不是说听起来很粗鲁,但你有没有在MSDN/ASP.NET上找到答案?周围有很多信息。每个模板都有很多,我在这里无法深入了解。每一个都有一个MSDN页面。

话虽如此,我会给你一个快速摘要,所以在这里跌跌撞撞的人会有一些信息。

ADO.NET实体数据模型

这是您为使用实体框架作为ORM而创建的文件,它是使用EF所必需的。在使用其他任何一个之前,您都需要这个。您可以使用多种不同的方法创建EDM,包括数据库优先(从DB生成)、代码优先、模型优先等。

基于服务的数据库

我从未听说过这个词,鉴于我最近一直在与英孚合作(并阅读),我怀疑这是否与英孚有关。

ADO.NET实体对象生成器

为从EntityObject类继承的实体生成类。与默认的EF代码生成器相同,不同之处在于没有将输出代码放入Model.edmx.designer.cs(默认)文件中,而是将代码放入单独的文件中。我个人认为这个模板没有任何好处。

ADO.NET自跟踪实体生成器

当您想要开发N层应用程序时(即,如果您想要允许WCF/Silverlight应用程序与您的模型一起工作),为实体生成类。实体被设置为可由EF图跟踪,以便处理来自各种应用程序的持久性操作。

ADO.NET C#POCO实体生成器

我的最爱。:)为从nothing继承的实体生成类。他们不知道自己被用来坚持。当您希望域/持久性层的持久性无知、可测试性和松散耦合时,请将其用于应用程序。

问题回答

暂无回答




相关问题
Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How are Models (in MVC) and DAOs supposed to interact?

How are models and DAOs supposed to interact? I m in the process of putting together a simple login module and I m unsure where to put the "business logic." If I put the logic with the data in the ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签