I am getting this error "The object cannot be deleted because it was not found in the ObjectStateManager."
My code is:
protected MyEntities sqlEntities;
public virtual void Delete(TEntity entity)
{
System.Type t = typeof(TEntity);
sqlEntities.DeleteObject(entity);
sqlEntities.SaveChanges();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…