I am sure I saw the answer to this question somewhere, but since I could not find it with a few searches in SO or google, I still ask it again ...
In the Entity Framework, the only way to delete a data object is
MyEntityModel ent = new MyEntityModel(); ent.DeleteObject(theObjectToDelete); ent.SaveChanges();
However, this approach requires that the object is loaded, in this case, first into the controller, only to delete it. Is there a way to delete a business object that references only its identifier?
If there is a smarter way to use Linq or Lambda expressions, this is good too. The main goal, however, is to avoid downloading data only to delete it.
asp.net-mvc linq-to-entities entity-framework
Tomas Lycken Feb 02 '09 at 10:38 2009-02-02 10:38
source share