有没有办法通过EntityKey删除一个实体加载它? [英] Is there a way to delete an entity by its EntityKey witout loading it?

查看:100
本文介绍了有没有办法通过EntityKey删除一个实体加载它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

链接Tamir有作品,但是它使用实体框架团队不再推荐的方法。



查看这个提示,它更接近正确的方法来做到这一点。并且更深入地涵盖了陷阱。 (Dislaimer:我会说我写的提示!)



希望这有帮助



Alex



项目经理实体框架团队。


Is there a way to delete an entity by its EntityKey witout loading it?

解决方案

The link Tamir has works, but it uses an approach that the Entity Framework team no longer recommends.

Check out this tip which is closer to the right way to do it. And also covers the gotchas in more depth. (Dislaimer: I would say that I wrote the tip!)

Hope this helps

Alex

Program Manager Entity Framework Team.

这篇关于有没有办法通过EntityKey删除一个实体加载它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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