Esempio n. 1
0
 private int SaveChanges()
 {
     return(UnitOfWork.TransactionEnabled ? 0 : UnitOfWork.SaveChanges());
 }
Esempio n. 2
0
 /// <summary>
 /// 更新实体对象
 /// </summary>
 /// <param name="entity">更新后的实体对象</param>
 /// <returns>操作影响的行数</returns>
 public int Update(TEntity entity)
 {
     entity.CheckNotNull("entity");
     ((DbContext)UnitOfWork).Update <TEntity, TKey>(entity);
     return(UnitOfWork.SaveChanges());
 }