2
我使用EF4.1刪除從我的數據庫中的對象:該對象無法刪除,因爲它在ObjectStateManager中找不到?
public virtual void Delete(T entity)
{
_entities.CreateObjectSet<T>().DeleteObject(entity);
}
得到一個錯誤:
The object cannot be deleted because it was not found in the ObjectStateManager
http://stackoverflow.com/questions/449740/error-the-object-cannot-be-deleted-because-it-was-not-found-in-the-objectstatem – Habib 2012-08-06 04:13:18
解決方案:http:// stackoverflow .COM /問題/ 7791149 /的對象,不能待刪除 - 因爲,它 - 是未找到,在最objectstatemanager/19422173#19422173 – Kjartan 2013-10-17 08:58:55