public IActionResult Update([FromBody] CustomerProductDTO customerProductDTO) { if (customerProductDTO == null) { return(NotFound()); } CustomerProduct customerProduct = customerProductDTO.ConvertCustomerProductDTOToCustomerProduct(); return(Execute(() => _baseCustomerProductService.Update(customerProduct))); }
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)); }