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:
parent
2f9501458f
commit
96c759e25c
|
|
@ -154,6 +154,11 @@ namespace Microsoft.AspNet.Mvc
|
||||||
RouteConstraints = new List<RouteDataActionConstraint>(),
|
RouteConstraints = new List<RouteDataActionConstraint>(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
actionDescriptor.DisplayName = string.Format(
|
||||||
|
"{0}.{1}",
|
||||||
|
action.ActionMethod.DeclaringType.FullName,
|
||||||
|
action.ActionMethod.Name);
|
||||||
|
|
||||||
var httpMethods = action.HttpMethods;
|
var httpMethods = action.HttpMethods;
|
||||||
if (httpMethods != null && httpMethods.Count > 0)
|
if (httpMethods != null && httpMethods.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue