简体   繁体   中英

Do ObjectContext and ObjectSet offer advantages over DbContext and DbSet?

I am currently finalizing the architecture of my new application that will be using Entity Framework as its ORM. However, I am a little bit confused with respect to whether I should go with the default option ( DbSet and DbContext ), or use a "tricky" option ( ObjectSet and ObjectContext )? Do the latter classes offer advantages over the default classes?

Just summarization. DbContext is a wrapper around the ObjectContext . You can also access ObjectContext by DbContext if you need. ObjectContext came with EF4 and DbContext with EF4.1. Basically both contexts are almost same. DbContext simplifies many things. Moreover DbContext doesn't contains hundreds of properties like ObjectContext - it is more clear and compact.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM