ef overview

8

Click here to load reader

Upload: uday-shankar

Post on 05-Jul-2015

48 views

Category:

Technology


0 download

DESCRIPTION

Entity framework

TRANSCRIPT

Page 1: Ef overview

Entity FrameworkThis presentation tells you :

Basics of Entity Framework

Page 2: Ef overview

What is EF?

• Entity framework is an Object/Relational Mapping (O/RM) framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database and working with the results in addition to Data Reader and Dataset.

Page 3: Ef overview

What is O/RM?

• ORM is a tool for storing data from domain objects to relational database like MS SQL Server in an automated way without much programming.

Page 4: Ef overview

Different approaches of EF

• a) Model First

• b) Code First

• c) Database First

Page 5: Ef overview

Model First

• In the Model First approach, the database model is created first using the ORM designer in Visual Studio. Once the model consisting of entities and relationships has been designed, the physical database will be generated from the model.

• For Example: Go through this link: https://www.simple-talk.com/dotnet/.net-framework/different-approaches-of-entity-framework/

Page 6: Ef overview

Code First

• In Code-First Approach, we create the classes first and then generate the database from the classes directly. In code first, we won’t use the Entity Designer (for editing .edmx files) at all.

• For Example: Go through this link: https://www.simple-talk.com/dotnet/.net-framework/different-approaches-of-entity-framework/

Page 7: Ef overview

Database First

• The next approach supported by the Entity Framework is the database-first approach. In the database first approach, we are creating the entity framework from an existing database. We use all other functionality, such as the model/database sync and the code generation, in the same way we used them in the Model First approach.

• For Example: Go through this link: https://www.simple-talk.com/dotnet/.net-framework/different-approaches-of-entity-framework/

Page 8: Ef overview

Advantages of EF

• Reduced development time: the framework provides the core data access capabilities so developers can concentrate on application logic.

• Developers can work in terms of a more application-centric object model, including types with inheritance, complex members, and relationships. In .NET Framework 4, the Entity Framework also supports Persistence Ignorance through Plain Old CLR Objects (POCO) entities.

• Applications are freed from hard-coded dependencies on a particular data engine or storage schema by supporting a conceptual model that is independent of the physical/storage model.

• Mappings between the object model and the storage-specific schema can change without changing the application code.

• Language-Integrated Query support (called LINQ to Entities) provides IntelliSense and compile-time syntax validation for writing queries against a conceptual model.