0

Possible Duplicate:
ObjectContext vs DbContext

What is the difference between DBContext and Object context in Entity Framework? Do they differ only in properties or they have any other significant difference?

Community
  • 1
  • 1
Pavan Kumar
  • 190
  • 2
  • 8
  • duplicate of...[entity-framework-4-1-objectcontext-vs-dbcontext](http://stackoverflow.com/questions/5376368/entity-framework-4-1-objectcontext-vs-dbcontext) and..[objectcontext-vs-dbcontext](http://stackoverflow.com/questions/9176967/objectcontext-vs-dbcontext) – Mark Oreta Sep 21 '12 at 13:15

1 Answers1

0

ObjectContext for EF v4.0 and when using a designer generated model and DbContext with for a EF v4.1 code first model.

Altough they are pretty much the samen, DbContext requires a lot less code for the same kind of functionality.

zeebonk
  • 4,864
  • 4
  • 21
  • 31
  • DbContext is not only for code first model. 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 and moreover it is more clear. – Milan Matějka Oct 28 '13 at 14:16