Entity Framework Tutorial Basics(2):What is Entity Framework?
What is Entity Framework?
Writing and managing ADO.Net code for data access is a tedious and monotonous job. Microsoft has provided an O/RM framework called "Entity Framework" to automate database related activities for your application.
Microsoft has given the following definition of Entity Framework:
The Microsoft ADO.NET Entity Framework is an Object/Relational Mapping (ORM) framework that enables developers to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects. The Entity Framework's ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.
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.
Entity framework is useful in three scenarios. First, if you already have existing database or you want to design your database ahead of other parts of the application. Second, you want to focus on your domain classes and then create the database from your domain classes. Third, you want to design your database schema on the visual designer and then create the database and classes.
The following figure illustrates the above scenarios.
As per the above figure, EF creates data access classes for your existing database, so that you can use these classes to interact with the database instead of ADO.Net directly.
EF can also create the database from your domain classes, thus you can focus on your domain-driven design.
EF provides you a model designer where you can design your DB model and then EF creates database and classes based on your DB model.
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. O/RM includes three main parts: Domain class objects, Relational database objects and Mapping information on how domain objects map to relational database objects (tables, views & storedprocedures). ORM allows us to keep our database design separate from our domain class design. This makes the application maintainable and extendable. It also automates standard CRUD operation (Create, Read, Update & Delete) so that the developer doesn't need to write it manually.
A typical ORM tool generates classes for the database interaction for your application as shown below.
Visit wikipedia for more information on Object-relational Mapping
There are many ORM frameworks for .net in the market such as DataObjects.Net, NHibernate, OpenAccess, SubSonic etc. Entity Framework is an open source ORM framework from Microsoft.
Please note that Entity Framework is an open source framework by Microsoft. You can contribute to the Entity Framework project on codeplex.
Entity Framework Tutorial Basics(2):What is Entity Framework?的更多相关文章
- Entity Framework Tutorial Basics(20):Persistence in Entity Framework
Persistence in Entity Framework There are two scenarios when persisting an entity using EntityFramew ...
- Entity Framework Tutorial Basics(8):Types of Entity in Entity Framework
Types of Entity in Entity Framework: We created EDM for existing database in the previous section. A ...
- Entity Framework Tutorial Basics(25):Delete Single Entity
Delete Entity using DBContext in Disconnected Scenario: We used the Entry() method of DbContext to m ...
- Entity Framework Tutorial Basics(24):Update Single Entity
Update Existing Entity using DBContext in Disconnected Scenario: In this chapter, you will learn how ...
- Entity Framework Tutorial Basics(23):Add Single Entity
Add New Entity using DBContext in Disconnected Scenario: In this chapter you will learn how to add n ...
- Entity Framework Tutorial Basics(1):Introduction
以下系列文章为Entity Framework Turial Basics系列 http://www.entityframeworktutorial.net/EntityFramework5/enti ...
- Entity Framework Tutorial Basics(31):Migration from EF 4.X
Migration from Entity Framework 4.1/4.3 to Entity Framework 5.0/6.0 To migrate your existing Entity ...
- Entity Framework Tutorial Basics(27):Update Entity Graph
Update Entity Graph using DbContext: Updating an entity graph in disconnected scenario is a complex ...
- Entity Framework Tutorial Basics(22):Disconnected Entities
Disconnected Entities: Before we see how to perform CRUD operation on disconnected entity graph, let ...
随机推荐
- ICE 的回调
使用分布式计算中间件ICE到现在已经有一年多了,在这一年里里面对ICE的理解.应用比较熟悉. 使用ICE写分布式软件,确实是很方便:ICE比较稳定.可靠,调用返回速度低延迟,使用简单,学习曲线不是很陡 ...
- CERC2016 爵士之旅 Jazz Journey
传送门(洛谷) 题目大意 给定$n$个位置,和一个长为$m$的序列$A$,你需要经过一条直接的边从第$A_i$个位置到第$A_{i+1}$个位置. 每条有向边$(u,v)$分为两种,第一种可以花费$C ...
- 小组项目需求——NABCD
关于项目微食堂的NABCD: N(need): 就我自己而言,每天在上午三四节课时就会想中午吃什么.而且大部分的课在二教,离食堂较远.可能会面临“抢不到饭”的问题.首先不知道去哪吃.吃什么,尤其在时间 ...
- [SP839]Optimal Marks
luogu 题意 给你一个无向图\(G(V,E)\). 每个顶点都有一个int范围内的整数的标记. 不同的顶点可能有相同的标记. 对于边\((u,v)\),我们定义\(Cost(u,v)=\rm ma ...
- python函数之sorted与sort
Python list内置sort()方法用来排序,也可以用python内置的全局sorted()方法来对可迭代的序列排序生成新的序列. sorted(iterable,key=None,revers ...
- 聊聊“现在学习MFC有用吗?”
我用MFC做了4年多,后来转到WPF也做了快5年.对于二者,不敢说精通,但应该算入门.结合自己经历,如果不考虑项目需求,我认为新手学习WPF或许更好点.有3点: 1)大家都知道最近几年Motorola ...
- 如果有多个集合的迭代处理情况【使用MAP】
在SQL开发过程中,动态构建In集合条件查询是比较常见的用法,在Mybatis中提供了foreach功能,该功能比较强大,它允许你指定一个集合,声明集合项和索引变量,它们可以用在元素体内.它也允许你指 ...
- Day2-VIM(六): 恢复
恢复在VIM里比较简单,不过想要具体恢复到某个时间段很难 就我的经验而言,有时候使用恢复还不如删了重写 这里我们来讲讲恢复.撤销和重复命令的使用 u 撤消上次命令 U 恢复整行 ctrl+r 重做 . ...
- 有关UCOS_II在LPC1768上的应用
https://www.cnblogs.com/chungshu/archive/2012/12/14/2818380.html
- AngularJS:应用
ylbtech-AngularJS:应用 1.返回顶部 1. AngularJS 应用 现在是时候创建一个真正的 AngularJS 单页 Web 应用(single page web applica ...