Skip to content

Commit

Permalink
Handle case where action method returns GriddlyResult subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
programcsharp committed Jan 12, 2024
1 parent 693d9b0 commit b164a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Build/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.6.38")]
[assembly: AssemblyFileVersion("3.6.38")]
[assembly: AssemblyVersion("3.6.39")]
[assembly: AssemblyFileVersion("3.6.39")]
//[assembly: AssemblyInformationalVersion("2.5-filters")]
6 changes: 3 additions & 3 deletions Griddly.Mvc/GriddlyParameterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ void OnActionExecuting(ActionExecutingContext filterContext)
{
#if NETFRAMEWORK
if (filterContext.ActionDescriptor.ActionName.EndsWith("grid", StringComparison.OrdinalIgnoreCase)
|| (filterContext.ActionDescriptor as ReflectedActionDescriptor)?.MethodInfo.ReturnType == typeof(GriddlyResult)
|| (filterContext.ActionDescriptor as TaskAsyncActionDescriptor)?.TaskMethodInfo.ReturnType == typeof(GriddlyResult))
|| typeof(GriddlyResult).IsAssignableFrom((filterContext.ActionDescriptor as ReflectedActionDescriptor)?.MethodInfo.ReturnType)
|| typeof(GriddlyResult).IsAssignableFrom((filterContext.ActionDescriptor as TaskAsyncActionDescriptor)?.TaskMethodInfo.ReturnType))
#else
if (filterContext.RouteData.Values["action"].ToString().EndsWith("grid", StringComparison.OrdinalIgnoreCase)
|| (filterContext.ActionDescriptor as ControllerActionDescriptor)?.MethodInfo.ReturnType == typeof(GriddlyResult))
|| typeof(GriddlyResult).IsAssignableFrom((filterContext.ActionDescriptor as ControllerActionDescriptor)?.MethodInfo.ReturnType))
#endif
{
var request = filterContext.HttpContext.Request;
Expand Down

0 comments on commit b164a67

Please sign in to comment.