Is there a way to delete an entity by its EntityKey witout loading it?
+1
A:
This will help you: http://sqlskills.com/BLOGS/BOBB/post/Entity-Framework-Beta3-Deleting-without-fetching.aspx
Tamir
2009-06-17 15:27:44
+1
A:
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.
Alex James
2009-06-17 22:54:11
I guess i qualify the 'out of luck' part, this fact that i have to provide parent PKs is really unncessarry it should be fixed, for my opinion it's just a bug.
Shimmy
2009-06-18 00:02:30
Most people agree with you and that is why the next version of the EF (starting with Beta2) introduces something called FK associations: http://blogs.msdn.com/efdesign/archive/2009/03/16/foreign-keys-in-the-entity-framework.aspx
Alex James
2009-06-18 01:20:10