Is it possible to开发者_运维技巧 check that an object is in the context before trying to delete that from context ?
thanks for help
Yes, something like:
var key = myContext.CreateEntityKey("Table", myObject);
if (myContext.TryGetObjectByKey(key, out otherObject))
{
// delete or edit otherObject
}
But you find in /delete from the database, not (just) the context.
精彩评论