action
A public method on a controller that handles requests for one route and returns a result.
In more detail
Each action handles one combination of HTTP method and route. Its parameters are filled by model binding and its return value, often an ActionResult<T>, becomes the HTTP response.
Related terms
- controller — In ASP.NET Core, a class deriving from ControllerBase that groups related HTTP endpoints as methods called actions.
- ActionResult<T> — The return type of a controller action that can be either a typed success payload or another HTTP result, such as NotFound().
- model binding — Turning parts of an HTTP request, such as route values, the query string, headers and the JSON body, into typed parameters for your handler.
Taught in
- Building Routes with Controllers — Modern .NET Core, C# & Enterprise Microservices
- Comparing Controllers and Minimal APIs — Modern .NET Core, C# & Enterprise Microservices