Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's Differences Between Using Entity Framework in Vs 2008 And 2010

You know firstly Entity Framework came with Visual Studio 2008 SP1. Now it is come with Visual Studio 2010.

The question is that, what are differences between these two version?

like image 699
mavera Avatar asked Apr 02 '10 06:04

mavera


People also ask

Why we use@ Entity?

Why Entity Framework? Entity Framework is an ORM and ORMs are aimed to increase the developer's productivity by reducing the redundant task of persisting the data used in the applications. Entity Framework can generate the necessary database commands for reading or writing data in the database and execute them for you.

When did Entity Framework come out?

The first version of Entity Framework was released in 2008, as part of . NET Framework 3.5 SP1 and Visual Studio 2008 SP1. Starting with the EF4. 1 release it has shipped as the EntityFramework NuGet Package - currently one of the most popular packages on NuGet.org.

What is Entity Framework in mvc?

What is Entity framework? Entity framework is an ORM (Object Relational Mapping) tool. Object Relational Mapping (ORM) is a technique of accessing a relational database; . i.e., whatever has tables and store procedure these things we interact with database in class, method and property of the object format.


1 Answers

  1. Persistence Ignorance: You can define your own POCO’s (Plain Old CLR Objects) that are decoupled from any specific persistence technology. This allows you to swap out one data access stack for another should the need arise.

  2. T4 Code Generation: EF 4 will ship with a number of T4 code-generation templates which you can customize or replace with your own. (T4 is a code-generation technology built into Visual Studio 2008 or later.)

  3. Lazy Loading: In addition to eager and explicit loading, related entities can be loaded automatically on demand. For example, with an Order class that has an OrderDetails property, marking this property as virtual will cause order details to be loaded from the database automatically when the OrderDetails property is enumerated.

  4. POCO Change-Tracking: EF4 will support two models for tracking changes on POCO’s. By default EF will take a snapshot of the original state of your objects and then compare it to the current version when saving changes. Alternatively, you can define properties as virtual so that their state is continually tracked and kept in sync with the object state manager.

  5. Better N-Tier Support with Self-Tracking Entities: The first CTP for EF4 includes a T4 template for generating entities that track their own changes on the client, which are then serialized when sent across service boundaries and saved to the database.

  6. Model-First Development: Create a model for your entities, then have Visual Studio 2010 generate DDL to create a database with matching tables and relations.

  7. Code-Only Development: Write classes and have EF infer a conceptual model (no edmx file!). You can even generate DDL from the dynamic model to create the database and tables.

cited from DevelopMentor

what's new in EF

like image 131
Alexander Taran Avatar answered Sep 17 '22 02:09

Alexander Taran