public async Task <TEntity> AddAsync(TEntity entity) { var result = _dbSet.Add(entity); await _context.CommitAsync(); return(result); }
public async Task AddAsync(Guid id) { var dbEntity = await Query().Where(c => c.Id == id).SingleOrDefaultAsync(); var model = _mapper.Map <TModel>(dbEntity); var cacheEntity = new TCacheEntity { Id = dbEntity.Id, Tenant = Tenant, Data = model.ToJson(), Date = DateTime.Now }; await _dbSet.AddAsync(cacheEntity); await _dbContext.CommitAsync(); }
public Task <int> CommitAsync() { return(_context.CommitAsync()); }
public Task <long> CommitAsync() { return(_context.CommitAsync()); }
public async Task <int> CommitAsync() { return(await _dbContext.CommitAsync()); }