コード例 #1
0
 public IActionResult Put([FromBody] ProductSizeAndPrice model)
 {
     try
     {
         uow.ProductSizeAndPriceRepo.Update(model);
         uow.SaveChanges();
         return(Created("/api/ProductSizeAndPrice", model));
     }
     catch
     {
         return(StatusCode(500));
     }
 }
コード例 #2
0
 public IActionResult Post([FromBody] ProductSizeAndPrice model)
 {
     try
     {
         uow.ProductSizeAndPriceRepo.Add(model);
         uow.SaveChanges();
         return(Created("/api/ProductSizeAndPrice", model));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.Message));
     }
 }