Skip to content

Commit e1c1cc7

Browse files
authored
Merge pull request #55 from jogibear9988/patch-1
Fix Nullable Enums from String
2 parents f62646f + bcb0f0d commit e1c1cc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/System.Linq.Dynamic.Core/ExpressionParser.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ Expression ParseComparison()
607607
object wrt = null;
608608
if (constantExpr.Value is string)
609609
{
610-
wrt = Enum.Parse(left.Type, constantExpr.Value as string, true);
610+
wrt = Enum.Parse(GetNonNullableType(left.Type), constantExpr.Value as string, true);
611611
}
612612
else
613613
{
@@ -620,7 +620,7 @@ Expression ParseComparison()
620620
object wrt = null;
621621
if (constantExpr.Value is string)
622622
{
623-
wrt = Enum.Parse(right.Type, constantExpr.Value as string, true);
623+
wrt = Enum.Parse(GetNonNullableType(right.Type), constantExpr.Value as string, true);
624624
}
625625
else
626626
{
@@ -2441,4 +2441,4 @@ internal static void ResetDynamicLinqTypes()
24412441
_keywords = null;
24422442
}
24432443
}
2444-
}
2444+
}

0 commit comments

Comments
 (0)