ObjectContext与DbContext [英] ObjectContext vs DbContext
问题描述
我读过很多与 ObjectContext vs DBContext 相关的帖子,这有点有意义。但我不知道我目前的实现。只是想知道它是反模式还是我玩安全?
DbContext
只是围绕 ObjectContext
DbContext
只是一组比 ObjectContext
所暴露的API更易于使用的方法这里有一个非常简单的VS模板,它使用Repository Pattern和EF
I've DbContext class from there I have an implementation of Generic Repositories and unit of work in a such way that leads to use ObjectContext. I followed this link in general.
I've read lot of posts related to the ObjectContext vs DBContext which somewhat makes sense. But I've no idea about my current implementation. just wondering if its an anti-pattern or I'm playing safe?
DbContext
is just a wrapper around ObjectContext
DbContext
is just a set of APIs that are easier to use than the APIs exposed by ObjectContext
Anyway here there is a very simple VS Template that uses Repository Pattern and EF
这篇关于ObjectContext与DbContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!