I stumbled upon this question: What is the purpose of the Name parameter in HttpPostAttribute
Which confused me at first but makes sense upon reading. However in learning about WebAPI I see the name parameter AS well as parameters for the name. Such as in the "pizza" example here:
[HttpPut("{id}")]
public IActionResult Update(int id, Pizza pizza)
{
if (id != pizza.Id)
return BadRequest();
var existingPizza = PizzaService.Get(id);
if (existingPizza is null)
return NotFound();
PizzaService.Update(pizza);
return NoContent();
}
So on first instinct these are just meant to be placeholder local variables I assume....but microsofts documentation on IActionResult
is honestly pretty thin. Is there anything specific we need to know about these parameters other than they are "local variables" that I assume get garbage collected after the request? Do they serve as a sort of property to tell the controller what objects "might" be used in the controller?