问题描述
从MSDN:
重新presents的单位按工作及库模式的组合,使您能够查询数据库,并组合在一起,然后将写回店为单位的变化。的DbContext在概念上类似于ObjectContext的。
我虽然的DbContext只处理连接到数据库和对数据库工作线程的数量。
I though DBContext only handle the connection to the DB and the number of threads working against the DB.
现在我明白它包含了跟踪machanisem?我认为这是在ObjectContext的。
Now I understand it contains the tracking machanisem? I thought this was in the ObjectContext.
那么,什么是(用简单的英语)它们之间的区别呢?
So what is (in plain english) the difference between them?
推荐答案
的DbContext是ObjectContext类,这是奠定差不多吧上的ObjectContext之上的轻量级版本(甚至还有一个办法,从刚刚得到的ObjectContext的的DbContext)。这也是很多更容易使用,国际海事组织,使CRUD操作一个sinch。
DbContext is a lightweight version of the ObjectContext class, which is laid almost right on top of ObjectContext (there is even a way to get to the ObjectContext from just the DbContext). It's also a lot easier to use, IMO, and makes CRUD operations a sinch.
有关更好的信息,谁更好看比Julie有关差异的详细信息勒曼,如被带进EF 4.1。
For better information, who better to look to than Julie Lerman for more info on the differences, as was brought into EF 4.1.
这篇关于什么是的DbContext和ObjectContext的之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!