What is Entity Framework?
1.什么是EntityFramework?
http://www.entityframeworktutorial.net/what-is-entityframework.aspx
Writing and managing ADO.Net code for data access is a tedious乏味 and monotonous单调 job.
Microsoft has provided an O/RM[object relational mapping]对象关系映射 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 oncodeplex.
目前最新的EntityFramework托管在github上,https://github.com/aspnet/EntityFramework
What is Entity Framework?的更多相关文章
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库
在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...
- Entity Framework Core 1.1 升级通告
原文地址:https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-entity-framework-core-1-1/ 翻译:杨晓东 ...
- Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制
将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...
- 来,给Entity Framework热热身
先来看一下Entity Framework缓慢的初始化速度给我们更新程序带来的一种痛苦. 我们手动更新程序时通常的操作步骤如下: 1)把Web服务器从负载均衡中摘下来 2)更新程序 3)预热(发出一个 ...
- 采用EntityFramework.Extended 对EF进行扩展(Entity Framework 延伸系列2)
前言 Entity Framework 延伸系列目录 今天我们来讲讲EntityFramework.Extended 首先科普一下这个EntityFramework.Extended是什么,如下: 这 ...
- Entity Framework教程(第二版)
源起 很多年前刚毕业那阵写过一篇关于Entity Framework的文章,没发首页却得到100+的推荐.可能是当时Entity Framework刚刚发布介绍EF的文章比较少.一晃这么多年过去了,E ...
- Entity Framework 6 Recipes 2nd Edition 译 -> 目录 -持续更新
因为看了<Entity Framework 6 Recipes 2nd Edition>这本书前面8章的翻译,感谢china_fucan. 从第九章开始,我是边看边译的,没有通读,加之英语 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之目录导航
ASP.NET MVC with Entity Framework and CSS是2016年出版的一本比较新的.关于ASP.NET MVC.EF以及CSS技术的图书,我将尝试着翻译本书以供日后查阅. ...
随机推荐
- 浅析Java反射机制
目前,在项目中使用Java反射机制(除Spring框架)的地方不多,但为后续准备,简单将最近的反射体会总结如下: 1. 按光学中的反射,可以将java中的反射理解为“镜像”.有以下用途: Java反射 ...
- 快速幂取模 分类: ACM TYPE 2014-08-29 22:01 95人阅读 评论(0) 收藏
#include<stdio.h> #include<stdlib.h> //快速幂算法,数论二分 long long powermod(int a,int b, int c) ...
- 在当前iframe中, 获取Iframe的id
window.frameElement 返回嵌入当前window对象的元素(比如 <iframe> 或者 <object>),如果当前window对象已经是顶层窗口,则返回 ...
- 安装成功的nginx如何添加未编译安装模块
原已经安装好的nginx,现在需要添加一个未被编译安装的模块举例说明:安装第三方的ngx_cache_purge模块(用于清除指定URL的缓存)nginx的模块是需要重新编译nginx,而不是像apa ...
- The life of an HTML HTTP request
https://developer.mozilla.org/en-US/docs/The_life_of_an_HTML_HTTP_request http://www.html5rocks.com/ ...
- IE8中能继续使用Expression的解决方案
在实际工作中,长的报表需要固定表头,比如DataGrid等控件. 过去在用IE8以前版本的时候,只需要在css中加上 position:relative ; top:expresion(this.of ...
- HDU3487 Play With Chains(Splay)
很裸的Splay,抄一下CLJ的模板当作复习,debug了一个下午,收获是终于搞懂了以前看这个模板里不懂的内容.以前用这个模板的时候没有看懂为什么get函数返回的前缀要加个引用,经过一下午的debug ...
- java与.net之间xml传递,xml最前面多了个?
最近做一个项目,是java提供webservice供.net调用.参数采用xml格式.首先碰到的问题: 1).net这边采用XmlSerializer 方式序列化对象传递给对方.对方在本机调试可以收到 ...
- POJ 2195
#include<iostream>//by Chengdacaizi #include<stdio.h> #include<vector> #include< ...
- Shell实现跳板机,为什么用跳板机
整理自:http://blog.chinaunix.net/uid-22101889-id-3167454.html 注意:请谨慎使用,到现在为止,使用了,我还没找到改回去的方法. 1. 问题 ...