예제 #1
0
        public async Task <CustomerDto> Add(CustomerDto customerDto, CancellationToken cancellationToken)
        {
            _dbContext.Customers.Add(_mapper.Map <Customer>(customerDto));
            await _dbContext.SaveChangesAsync(cancellationToken);

            return(customerDto);
        }
예제 #2
0
        public async Task <UserDto> Add(UserDto userDto, CancellationToken cancellationToken)
        {
            _dbContext.Users.Add(_mapper.Map <User>(userDto));
            await _dbContext.SaveChangesAsync(cancellationToken);

            return(userDto);
        }