Add friendly name to action descriptor. Issue 820

Used in error messages for various attribute routing pieces, and anywhere
that you need a display name for an AD.
This commit is contained in:
Ryan Nowak 2014-07-29 12:26:53 -07:00
parent 2f9501458f
commit 96c759e25c
1 changed files with 5 additions and 0 deletions

View File

@ -154,6 +154,11 @@ namespace Microsoft.AspNet.Mvc
RouteConstraints = new List<RouteDataActionConstraint>(),
};
actionDescriptor.DisplayName = string.Format(
"{0}.{1}",
action.ActionMethod.DeclaringType.FullName,
action.ActionMethod.Name);
var httpMethods = action.HttpMethods;
if (httpMethods != null && httpMethods.Count > 0)
{