实体截断/清除/更新 [英] Entity Truncate / Clear / Update

查看:67
本文介绍了实体截断/清除/更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我是实体框架的新手,所以我为似乎是一个简单的问题道歉。我通过ADO.NET实体框架填充了几个带有数据的列表框,这个框架运行得非常好。现在,当用户从列表中删除了10个内容时,我希望
清除实体对象,然后添加列表中的内容。(而不是跟踪原始列表的增量和新列表然后删除丢失的项目我只想"截断"然后重新填充)   我假设我会使用Linq命令执行
这个但不确定如何将其发送出来?

I am new to the Entity Framework so my apologies for what seems to be a simple question. I populate a couple of listboxes with data via the ADO.NET Entity framework which works quite nicely. Now when the user deletes say 10 things from the list I'd like to clear the entity object then add what is in the list back in. (Rather than tracking the deltas of the original list and the new list then removing the missing items I just want to "truncate" then repopulate)   I am assuming I would do this with a Linq command but not sure exactly how to send it in?

 

非常感谢提示或文章

JB

推荐答案

您好,

以下是使用linq插入/更新/减少数据的示例,我相信它对您有所帮助:

http://msdn.microsoft.com/en-us/vbasic/bb737928.aspx

Here are samples for insert/update/delate data using linq, I believe it is helpful to you:
http://msdn.microsoft.com/en-us/vbasic/bb737928.aspx

如果您愿意,请发布您已有的代码段,这可以为我们提供您想要实现的更多信息。

If you will, please post a code snippet you already have, that could provide us more information of what you want to achieve.

提前致谢!


这篇关于实体截断/清除/更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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