public async Task <RegulatoryEntity> UpdateRegulatoryByIdAsync(RegulatoryEntity regulatoryEntity, CancellationToken token) { _dbContext.Regulatories.Update(regulatoryEntity); await _dbContext.SaveChangesAsync(token); return(regulatoryEntity); }
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)); }