ADO.Net实体模型(EDMX)与实体框架(V4.0等) [英] ADO.Net Entity Model (edmx) vs Entity Framework(v4.0 etc)

查看:223
本文介绍了ADO.Net实体模型(EDMX)与实体框架(V4.0等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用ADO.Net实体模型的好处EF?

What are the benefits of using ADO.Net Entity Model and EF?

我们能在一个项目中使用他们两个在一起。我碰到的地方,用户都使用这两种EDMX和EF为他的应用程序的示例。我不知道什么是这样做的目的。

Can we use both of them together in a project. I came across an example where, the user had used both edmx and ef for his application. I am not sure what is the purpose of that.

感谢

推荐答案

EDMX神器(无论是在磁盘模式第一和数据库首先在文件的形式接近或由EF运行时所产生的 - code首先方法)描述你的模型,您的数据库和它们之间的映射。目前,EF总是需要它的工作。唯一的细微差别是,codeFirst应用程序(或者,在使用的DbContext一般情况下,应用程序)这个文件是在从您的类动态生成的,你不与它直接处理,而在情况模型优先/数据库首先在哪里您使用的ObjectContext该文件是在磁盘上的和(通常)被分开,嵌入在您的程序集。

Edmx artifact (either in the form of a file on the disk for Model First and Database First approaches or being generated by the EF runtime - Code First approach) describes your model, your database and the mapping between these. At the moment EF always needs it to work. The only nuance is that for CodeFirst applications (or, in general, applications using DbContext) this file is generated on the fly from your classes and you don't deal with it directly while in case of Model First/Database First where you use the ObjectContext the file is on your disk and (usually) is split and embedded in your assembly.

修改

EF6不再创建并使用的工件内部(至少对于CSDL和SSDL份)。但是你仍然可以使用转储模式EDMX形式 EdmxWriter.WriteEdmx

EF6 no longer creates and uses artifacts internally (at least for CSDL and SSDL parts). However you can still dump the model in form of EDMX using EdmxWriter.WriteEdmx

这篇关于ADO.Net实体模型(EDMX)与实体框架(V4.0等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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