EF 4.0 vs EF 4.1(ObjectContext vs DbContext) what are advantage and disadvantage? RRS feed

  • Question

  • Hi,

    I would like to know so that i can shift.



    Tuesday, December 27, 2011 3:51 PM


  • Hi Mr.Weera PongPruchya;

    From the ADO.NET team blog :

    What’s in EF 4.1?

    ADO.NET Entity Framework 4.1 introduces two new features:

    • The DbContext API is a simplified abstraction over ObjectContext and a number of other types that were included in previous releases of the ADO.NET Entity Framework. The DbContext API surface is optimized for common tasks and coding patterns. DbContext can be used with Database First, Model First and Code First development.
    • Code First is a new development pattern for the ADO.NET Entity Framework and provides an alternative to the existing Database First and Model First patterns. Code First is focused around defining your model using C#/VB.NET classes, these classes can then be mapped to an existing database or be used to generate a database schema. Additional configuration can be supplied using Data Annotations or via a fluent API.


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Allen_MSDN Wednesday, December 28, 2011 2:03 AM
    • Marked as answer by Allen_MSDN Friday, December 30, 2011 2:23 AM
    Tuesday, December 27, 2011 4:30 PM