Exemplo n.º 1
0
        public async Task <RegulatoryEntity> UpdateRegulatoryByIdAsync(RegulatoryEntity regulatoryEntity, CancellationToken token)
        {
            _dbContext.Regulatories.Update(regulatoryEntity);
            await _dbContext.SaveChangesAsync(token);

            return(regulatoryEntity);
        }
Exemplo n.º 2
0
        public async Task <RegulatoryEntity> CreateRegulatoryAsync(RegulatoryEntity regulatoryEntity, CancellationToken token)
        {
            await _dbContext.Regulatories.AddAsync(regulatoryEntity, token);

            await _dbContext.SaveChangesAsync(token);

            return(await _dbContext.Regulatories
                   .SingleAsync(regulatory => regulatory.Id == regulatoryEntity.Id, token));
        }