예제 #1
0
 public IActionResult CreateProduct([FromBody] ProductModels productModels)
 {
     try
     {
         var productClass  = new ProductClass();
         var createProduct = productClass.CreateProductModels(productModels);
         var json          = JsonSerializer.Serialize(createProduct);
         return(Ok(json));
     }
     catch (Exception exception)
     {
         return(StatusCode(500, exception.Message));
     }
 }