What is the entity Framework
Writing and managing ADO is a tedious and boring task. Microsoft provides an ORM framework called "Entity Framework" for your app to automate the management of your database.
Microsoft has given the following definition to the Entity Framework:
EF is an object-relational mapping (ORM) framework that enables developers to define domain-specific objects with relational data, and developers no longer need to write large amounts of database access code. Using the entity Framework, developers use LINQ to help them query, and the retrieved data automatically generates strongly typed objects. EF offers such as change tracking, authentication, lazy loading, and query compilation that allow developers to focus more on their business logic rather than on the development of data access modules. EF is enhanced based on ADO, which provides developers with an automated data persistence mechanism.
EF can be used in the following three scenarios. First, if you already have a database of existing, or you want to design your database first and then do other development. Second, you just want to focus on designing a specific domain class before you use these classes to build the database. Thirdly, you want to design your database model from the designer provided by Visual Studio, and then build the database and the corresponding classes from that model.
The above three cases are illustrated by examples.
1.EF helps you build classes from existing databases so that you can work with the instances generated by this class and with ADO.
2. You can focus on your business to design types, and EF helps you create databases based on these types.
3.EF provides a model designer, and when you're done, EF helps you build your database and generate type code.
What is ORM
ORM is a tool that helps you transform objects into data in a relational database, such as in MS SQL Server, and is fully automated without the need for additional code. O/RM includes three main aspects: a business object, a relational database object, and a mapping information object that transforms a business object into a database object (such as a table, view, stored procedure). ORM allows us to design databases and business object classes independently. This makes our applications easier to maintain and to scale. So programmers can no longer manually write Crud (Create, Read, Update, Delete) operations.
ORM helps you generate classes and interoperate with the database, as shown below
In addition to the Open source ORM Framework EF provided by Microsoft, there are many. NET ORM frameworks, such as Dataobjects.net, NHibernate, openaccess, subsonic, etc.
Entity Framework Tutorial-what is the Entity Framework