vendredi 14 mars 2014

Linq To Entity: delete a row


Vote count:

0




I want delete a row in the database using linq to entity. I have:



using (SIEntities siContext = new SIEntities())
{
//linq query to find object to delete

siContext.MyEntities.DeleteObject(myobject);
}


Anyway the methos DeleteObject doesn't exist (as Delete()). I've tried also siContext.DeleteObject() and siContext.Delete() but don't find that method. Missing some namespaces? How can i delete the object?



asked 2 mins ago

Tom

309





Aucun commentaire:

Enregistrer un commentaire