示例#1
0
 private async Task <int> SaveChangesAsync()
 {
     return(UnitOfWork.TransactionEnabled ? 0 : await UnitOfWork.SaveChangesAsync());
 }
示例#2
0
 /// <summary>
 /// 异步更新实体对象
 /// </summary>
 /// <param name="entity">更新后的实体对象</param>
 /// <returns>操作影响的行数</returns>
 public async Task <int> UpdateAsync(TEntity entity)
 {
     entity.CheckNotNull("entity");
     ((DbContext)UnitOfWork).Update <TEntity, TKey>(entity);
     return(await UnitOfWork.SaveChangesAsync());
 }