Exemple #1
0
        public async Task <TEntity> AddAsync(TEntity entity)
        {
            var result = _dbSet.Add(entity);
            await _context.CommitAsync();

            return(result);
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 public Task <int> CommitAsync()
 {
     return(_context.CommitAsync());
 }
Exemple #4
0
 public Task <long> CommitAsync()
 {
     return(_context.CommitAsync());
 }
Exemple #5
0
 public async Task <int> CommitAsync()
 {
     return(await _dbContext.CommitAsync());
 }