如何检查Entity Framework中是否存在对象 [英] How to check if object exists in Entity Framework
本文介绍了如何检查Entity Framework中是否存在对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码,
Hi,
This is my code,
var results = context.Cells.Where((Cell c) => !loadOperation.Entities.Contains(c)).ToList();
results.ForEach((Cell c) => context.Cells.Detach(c));
如何使用Lambada表达式检查实体框架中是否存在对象
How to check if object exists in Entity Framework using Lambada expression
推荐答案
http://www.streetrat.in/Articles/Content/Check-an -object-exists-in-entity-framework.99.aspx?RatHistory = 99 [ ^ ]
这里已经讨论过这个快乐的编码
http://www.streetrat.in/Articles/Content/Check-an-object-exists-in-entity-framework.99.aspx?RatHistory=99[^]
This has been discussed here happy coding
这篇关于如何检查Entity Framework中是否存在对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文