ASP.NET

ENTITY FRAMEWORK (EF)

Entity Framework is an open source object-relational mapping (ORM) framework for ADO.NET, is a part of.NET Framework. The EF is a set of technologies in ADO.NET that support the development of data-oriented software applications.

The architects and developers of data-oriented applications have typically struggled with the need to achieve two objectives. They must model the entities, relationships, and logic of business problems they are solving, and they must also work with the data engines used to store and retrieve the data. The data may span in multiple storage systems, each with their own protocols; even if the applications that work with the single storage system must balance the requirements of the storage system against the requirements of writing efficient and maintainable code.

The Entity Framework helps developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying DB tables and columns where this data is stored.

Main objective of EF is to abstract the ties to a relational database , in such a way that the developer can relate to the DB(database) entity as to a set of objects and then to classes other than their properties .There are three different approaches for developing an application using EF. They are Database-First,Code-First and Model-First.

In the Database-First approach, we generate the context and entities for the existing DB using EDM wizard integrated in Visual Studio or executing EF commands.

Code-First is used when we don’t have an existing DB for the application. With this approach, we start by writing entities (domain classes) and context class first and then create the DB from these classes using migration commands.

In model-first, we create entities, relationships, and inheritance hierarchies directly on the visual designer, integrated in Visual Studio and then generate entities, the context class, and the DB script from visual model.

Author: STEPS

Leave a Reply

Your email address will not be published. Required fields are marked *