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?的更多相关文章

  1. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库

    在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...

  2. Entity Framework Core 1.1 升级通告

    原文地址:https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-entity-framework-core-1-1/ 翻译:杨晓东 ...

  3. Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制

    将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...

  4. 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)

    前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...

  5. 来,给Entity Framework热热身

    先来看一下Entity Framework缓慢的初始化速度给我们更新程序带来的一种痛苦. 我们手动更新程序时通常的操作步骤如下: 1)把Web服务器从负载均衡中摘下来 2)更新程序 3)预热(发出一个 ...

  6. 采用EntityFramework.Extended 对EF进行扩展(Entity Framework 延伸系列2)

    前言 Entity Framework 延伸系列目录 今天我们来讲讲EntityFramework.Extended 首先科普一下这个EntityFramework.Extended是什么,如下: 这 ...

  7. Entity Framework教程(第二版)

    源起 很多年前刚毕业那阵写过一篇关于Entity Framework的文章,没发首页却得到100+的推荐.可能是当时Entity Framework刚刚发布介绍EF的文章比较少.一晃这么多年过去了,E ...

  8. Entity Framework 6 Recipes 2nd Edition 译 -> 目录 -持续更新

    因为看了<Entity Framework 6 Recipes 2nd Edition>这本书前面8章的翻译,感谢china_fucan. 从第九章开始,我是边看边译的,没有通读,加之英语 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

  10. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之目录导航

    ASP.NET MVC with Entity Framework and CSS是2016年出版的一本比较新的.关于ASP.NET MVC.EF以及CSS技术的图书,我将尝试着翻译本书以供日后查阅. ...

随机推荐

  1. TestDriven.Net

    转: http://www.cnblogs.com/AlexLiu/archive/2008/12/01/1345002.html

  2. 从CMO到龙泉寺弟子:佛法改变人生

    今天,移动精英开发社为大家请来了佛家弟子孫濟初师兄给大家分享学佛心得.濟初师兄根据自己的亲身经历,讲述了佛法对他人生的影响,以及他所获得的启示.本文系国内ITOM管理平台OneAPM授权转载. 孫濟初 ...

  3. Javascript Date类常用方法详解

    getDate :得到的是今天是 几号(1-28.29.30.31). getDay  :  得到的是今天是 星期几(1-7). getFullYear : 得到的是今天是 几几年(4位). getH ...

  4. POJ 1422

    #include <iostream> #define MAXN 350 using namespace std; int mat[MAXN][MAXN]; bool mark[MAXN] ...

  5. 历代诗词咏宁夏注释1----常星景:< 六盘>

    六盘 常星景 关中形势甲天下,四岳分峙西太华.[1] 中有汭泾经纬之,六盘嵚崎历历落.[2] □□□□其流亚,终年峰头雪不消. 弟畜太白兒美高,眼底培缕纷纷何足数,呼吸想通天尺五.[3] 西北堆镇一切 ...

  6. SQL 比较乱

    --DROP TABLE T_UserInfo---------------------------------------------------- --建测试表 CREATE TABLE T_Us ...

  7. HDU 1698 Just a Hook (线段树区间更新)

    题目链接 题意 : 一个有n段长的金属棍,开始都涂上铜,分段涂成别的,金的值是3,银的值是2,铜的值是1,然后问你最后这n段总共的值是多少. 思路 : 线段树的区间更新.可以理解为线段树成段更新的模板 ...

  8. java理论基础学习一

    java的最大优势是跨平台 java的版本和体系架构 1.J2EE   Java 2 Enterprise Edition 定位在服务器端的应用 2.J2SE   Java 2 Standard Ed ...

  9. oracle连接数据

    1.源代码 string connString = "User ID=scott;Password=yanhong;Data Source=(DESCRIPTION = (ADDRESS_L ...

  10. 使用内网的Docker Image启动AcmeAir应用

    1.修改docker启动选项,添加信赖私有仓库 为了拉取docker.oneapm.me仓库里的镜像,我们需要将它添加为信赖仓库,方式是在启动选项中添加 --insecure-registry doc ...