Example #1
0
 public IActionResult AddDepartmentToProduct([FromBody] ProductDepartment productDeparment)
 {
     try
     {
         _productData.AddDepartmentInProduct(productDeparment);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(Problem(ex.Message, nameof(AddDepartmentToProduct), StatusCodes.Status500InternalServerError, "Fail adding the department in product."));
     }
 }