Пример #1
0
        public async Task <IActionResult> AddCustomerAsync([FromBody] CustomerDTO itemDTO)
        {
            var item = _mapper.Map <Entities.Customer>(itemDTO);
            var res  = await _customerService.AddCustomerAysnc(item);

            if (res == null)
            {
                return(BadRequest(res));
            }
            var resDto = _mapper.Map <CustomerDTO>(res);

            return(Ok(resDto));
        }