我正在使用 EF4.1 从我的数据库中删除一个对象:
public virtual void Delete(T entity)
{
_entities.CreateObjectSet<T>().DeleteObject(entity);
}
收到错误:
The object cannot be deleted because it was not found in the ObjectStateManager
我正在使用 EF4.1 从我的数据库中删除一个对象:
public virtual void Delete(T entity)
{
_entities.CreateObjectSet<T>().DeleteObject(entity);
}
收到错误:
The object cannot be deleted because it was not found in the ObjectStateManager