Action Method

noun

say it: “AK-shun METH-ud” /ˈækʃən ˈmɛθəd/

A public method in a controller that handles one kind of request and returns a result.

What is Action Method?

An action method is a public method on a controller that handles one endpoint.

[HttpDelete("{id:int}")]
public async Task<IActionResult> Delete(int id)
{
    await recipes.DeleteAsync(id);
    return NoContent();
}

In a sentence

  • “The Details action method finds one product and returns its view.”

Level: Apprentice · More ASP.NET Core terms at this level

Updated