EF在单例模式及C/S方式开发时,操作数据对象以后如果发生异常,要做善后工作。 try{ 删除或修改 }catch { _DBContext.Refresh(RefreshMode.StoreWins, entity); }