using System; using Microsoft.AspNetCore.Mvc.ApplicationModels; namespace AppModelSample.Conventions { public class CustomActionNameAttribute : Attribute, IActionModelConvention { private readonly string _actionName; public CustomActionNameAttribute(string actionName) { _actionName = actionName; } public void Apply(ActionModel actionModel) { // this name will be used by routing actionModel.ActionName = _actionName; } } }