1.

What is an Action Method?

Answer»

An ACTION method is a method in a controller class with the following restrictions:

  1. It must be public. Private or protected methods are not ALLOWED
  2. It cannot be overloaded.
  3. It cannot be a static method.

An action method executes an action in response to an HTTP request.

For example, here is an example of an Index() action method on the PostController. It takes an ID as an input and returns an IActionResult, which can be implemented by any result classes (SEE the following question).

public class PostController : Controller{ public IActionResult Index(INT id) { }}


Discussion

No Comment Found