实体框架中DataAdapter.Fill和DataAdapter.Update方法的等价性是什么? [英] What are the equivalence of DataAdapter.Fill and DataAdapter.Update Method in entity framework?

查看:95
本文介绍了实体框架中DataAdapter.Fill和DataAdapter.Update方法的等价性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道DataAdapter.Fill方法在内存和数据存储中桥接数据集。

DataAdapter.Fill()用于从数据库加载数据。 DataAdapter.Update()使用底层连接将所有已更改的数据信息提交到数据库。

那么实体框架中DataAdapter.Fill方法和DataAdapter.Update的等价性是什么?



我猜在实体框架中SaveChanges()相当于DataAdapter.Update。

We know DataAdapter.Fill Method bridges the dataset in memory and data store.
DataAdapter.Fill() is used to load data from database. DataAdapter.Update() commits all the changed data information to the database using the underlying connection.
Then what are the equivalence of DataAdapter.Fill Method and and DataAdapter.Update in entity framework?

I guess in entity framework SaveChanges() is equivalent to DataAdapter.Update.

推荐答案

SaveChanges [ ^ ]用于添加,删除和更新(修改)操作。要从上下文中获取数据,您需要编写Linq查询,例如:

SaveChanges[^] is used with add, delete and update (modify) operation. To get data from context, you need to write Linq query, such as:
return context.Orders.Where(o=>o.ClientId == clientid);





如需了解更多信息,请参阅:

在Entity Framework 4.0中添加,更新和删除对象 [ ^ ]

ADO.NET实体:插入更新和删除 [< a href =http://blogs.msdn.com/b/wriju/archive/2008/08/21/ado-net-entity-insert-update-and-delete.aspxtarget =_ blanktitle =新窗口> ^ ]

简单示例实体框架 [ ^ ]

使用实体实现基本的CRUD功能ASP.NET MVC应用程序中的框架 [ ^ ]

< a href =http://www.codeproject.com/Articles/695850/Complete-CRUD-Operations-in-MVC>使用实体框架5在MVC 4中完成CRUD操作,而无需编写单行代码 [ ^ ]

使用Entity Framework 6进行CRUD操作MVC 5中的Code First方法 [ ^ ]



For further information, please see:
Add, Update and Delete Objects in Entity Framework 4.0[^]
ADO.NET Entity: Insert Update and Delete[^]
Simple Sample with Entity Framework [^]
Implementing Basic CRUD Functionality with the Entity Framework in ASP.NET MVC Application[^]
Complete CRUD Operations in MVC 4 using Entity Framework 5 Without Writing a Single Line of Code[^]
CRUD operation with Entity Framework 6 Code First approach in MVC 5[^]


这篇关于实体框架中DataAdapter.Fill和DataAdapter.Update方法的等价性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆