Exemplo n.º 1
0
 public IActionResult Put(int id, [FromBody] string name)
 {
     try
     {
         productsService.UpdateProductName(id, name);
         return(Ok());
     }catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, "Error al actualizar el nombre"));
     }
 }
 public static void ChangeProductName(int productId, string productName)
 {
     productService.UpdateProductName(productId, productName);
 }