简体   繁体   English

EF类上下文

[英]EF class context

I have Microsoft VS 2010.In C# for retrieving data from database i use Ado.Net entity data model.This is Entity Framework? 我有Microsoft VS 2010.在C#中用于从数据库检索数据,我使用Ado.Net实体数据模型。这是实体框架吗? I see in many articles that context created by Entity Framework is derived from dbContext but in my project context is derived form ObjectContext . 我在许多文章中看到由Entity Framework创建的上下文是从dbContext派生的,但是在我的项目上下文中是从ObjectContext派生的。 So, what is EF? 那么,EF是什么?

EF 4.0 (which is part of the .net Framework) uses System.Data.Entities.ObjectContext from EF 4.3 (which was Opensourced project and is not part of the Framework) onwards uses System.Data.Entities.DbContext . EF 4.0(这是.NET Framework的一部分)使用System.Data.Entities.ObjectContext从EF 4.3(这是Opensourced项目,而不是框架的一部分)开始使用System.Data.Entities.DbContext

Both are EntityFramework. 两者都是EntityFramework。 One is newer. 一个是新的。 Both uses ADO.NET under the covers. 两者都在后台使用ADO.NET。

Yes, it is Entity Framework. 是的,它是实体框架。 However, context should be derived from ObjectContext . 但是,上下文应从ObjectContext派生。 The ObjectSet 对象集

Represents a typed entity set that is used to perform create, read, update, and delete operations. 表示用于执行创建,读取,更新和删除操作的类型化实体集。 and it was introduced in .NET 4.0 它是在.NET 4.0中引入的

You may also take a look on this for additional information on object sets. 您也可以采取一起来看看对对象集的附加信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM