Skip to content

Commit

Permalink
Fix error in GriddlyParameterAttribute when parameter is a model class
Browse files Browse the repository at this point in the history
  • Loading branch information
jehhynes committed Oct 1, 2019
1 parent d5bdf61 commit 15725f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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.2.7")]
[assembly: AssemblyFileVersion("3.2.7")]
[assembly: AssemblyVersion("3.2.8")]
[assembly: AssemblyFileVersion("3.2.8")]
//[assembly: AssemblyInformationalVersion("2.5-filters")]
3 changes: 2 additions & 1 deletion Griddly.Mvc/GriddlyParameterAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -34,7 +35,7 @@ public override void OnActionExecuting(ActionExecutingContext filterContext)

foreach (var param in filterContext.ActionParameters.ToList())
{
if (param.Value != null)
if (param.Value != null && (param.Value.GetType().IsValueType || typeof(IEnumerable).IsAssignableFrom(param.Value.GetType())))
{
bool isParamSet = context.CookieData?.Values?.ContainsKey(param.Key) == true || parentKeys.Contains(param.Key) || filterContext.RouteData.Values.ContainsKey(param.Key);

Expand Down

0 comments on commit 15725f5

Please sign in to comment.