public async Task <CustomerDto> Add(CustomerDto customerDto, CancellationToken cancellationToken) { _dbContext.Customers.Add(_mapper.Map <Customer>(customerDto)); await _dbContext.SaveChangesAsync(cancellationToken); return(customerDto); }
public async Task <UserDto> Add(UserDto userDto, CancellationToken cancellationToken) { _dbContext.Users.Add(_mapper.Map <User>(userDto)); await _dbContext.SaveChangesAsync(cancellationToken); return(userDto); }