Пример #1
0
        public IActionResult Update([FromBody] CustomerProductDTO customerProductDTO)
        {
            if (customerProductDTO == null)
            {
                return(NotFound());
            }

            CustomerProduct customerProduct = customerProductDTO.ConvertCustomerProductDTOToCustomerProduct();

            return(Execute(() => _baseCustomerProductService.Update(customerProduct)));
        }
Пример #2
0
        public IActionResult Create([FromBody] CustomerProductDTO customerProductDTO)
        {
            if (customerProductDTO is null)
            {
                throw new ArgumentNullException(nameof(customerProductDTO));
            }

            if (customerProductDTO is null)
            {
                throw new ArgumentNullException(nameof(customerProductDTO));
            }

            if (customerProductDTO == null)
            {
                return(NotFound());
            }

            CustomerProduct customerProduct = customerProductDTO.ConvertCustomerProductDTOToCustomerProduct();

            return(Execute(() => _baseCustomerProductService.Add <CustomerProduct>(customerProduct).Id));
        }