OnActionAttribute

[ValidateJsonAntiForgeryToken]

Allows multiple submit buttons to the same action but separated by button name.

Usage

[HttpPost, ActionName("Index"), OnAction(ButtonName = "Save")]
[ValidateAntiForgeryToken]
public IActionResult MyFunction()
{
...
}