ef overview
DESCRIPTION
Entity frameworkTRANSCRIPT
![Page 1: Ef overview](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/1.jpg)
Entity FrameworkThis presentation tells you :
Basics of Entity Framework
![Page 2: Ef overview](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/2.jpg)
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](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/3.jpg)
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](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/4.jpg)
Different approaches of EF
• a) Model First
• b) Code First
• c) Database First
![Page 5: Ef overview](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/5.jpg)
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](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/6.jpg)
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](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/7.jpg)
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](https://reader038.vdocuments.mx/reader038/viewer/2022100604/55986c461a28ab330b8b484e/html5/thumbnails/8.jpg)
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.