Entity Framework tutorial -- What is Entity Framework, frameworkentity

Source: Internet
Author: User

Entity Framework tutorial -- What is Entity Framework, frameworkentity

What is Entity Framework?

Writing and managing ADO. NET is a tedious and boring task. Microsoft provides an ORM Framework named "Entity Framework" for your application to automatically manage your database.

Microsoft defines Entity Framework as follows:

EF is an object relational ing (ORM) framework that allows developers to define objects in specific fields using relational data, and developers no longer need to write a large amount of database access code. With the Entity Framework, developers use Linq to help them perform queries. The retrieved data automatically generates strongly-typed objects. EF provides change tracking, authentication, delayed loading, and query compilation, allowing developers to focus more on their business logic rather than the development of data access modules. EF is enhanced based on ADO. NET. It provides developers with an automatic data persistence mechanism.

EF can be used in the following three scenarios. First, if you already have a database, or you want to design your database before other development. Second, you only want to focus on designing classes in specific fields before using these classes to generate databases. Third, you want to design your database model through the designer provided by visual studio, and then generate the database and corresponding classes from the model.

The preceding three cases are described as examples.

1. EF helps you create a class from an existing database, so that you can use the instance generated by this class to deal with ADO. NET.

2. You can focus on your business to design types. EF helps you create databases based on these types.

3. EF provides a model designer. After the design is complete, EF helps you generate databases and type code.

 

What is ORM?

ORM is a tool that helps you convert objects into data in relational databases. For example, it is stored in ms SQL Server and is fully automated without additional code. O/RM includes three main aspects: Business Objects, relational database objects, and ing information objects that convert business objects to database objects (such as tables, views, and stored procedures. ORM allows us to independently design databases and business object classes. This makes our applications easier to maintain and expand. Therefore, programmers can no longer manually write CRUD (Create, Read, Update, Delete) operations.

ORM helps you generate classes and interoperate with databases, as shown below:

In addition to the open-source ORM framework EF provided by Microsoft, there are also many. net ORM frameworks, such as DataObjects. Net, nhib.pdf, OpenAccess, and SubSonic.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.