From 96c759e25c45be6f878a2a2c470cb5c99e4afd70 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Tue, 29 Jul 2014 12:26:53 -0700 Subject: [PATCH] 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. --- .../ReflectedActionDescriptorProvider.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs b/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs index 4c4aecd1dc..d5e668f70e 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptorProvider.cs @@ -154,6 +154,11 @@ namespace Microsoft.AspNet.Mvc RouteConstraints = new List(), }; + actionDescriptor.DisplayName = string.Format( + "{0}.{1}", + action.ActionMethod.DeclaringType.FullName, + action.ActionMethod.Name); + var httpMethods = action.HttpMethods; if (httpMethods != null && httpMethods.Count > 0) {