I am using version:
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.11" />
I am trying to filter by enum and pass value as parameter, but I get exception
Expression of type 'System.Nullable`1[MyModule]' expected
This works:
this.Query<DbMenu>().Where("Module=4")
and this doesn't:
this.Query<DbMenu>().Where("Module=@0", 4)
Entity source:
public enum MyModule { Core, ... }
public class DbMenu
{
public MyModule? Module {get;set;}
...
}
Callstack:
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConstantExpressionToEnum(Int32 pos, Type leftType, ConstantExpression constantExpr) in /Parser/ExpressionParser.cs:line 569
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator() in /Parser/ExpressionParser.cs:line 460
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator() in /Parser/ExpressionParser.cs:line 360
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn() in /Parser/ExpressionParser.cs:line 280
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAndOperator() in /Parser/ExpressionParser.cs:line 263
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator() in /Parser/ExpressionParser.cs:line 248
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLambdaOperator() in /Parser/ExpressionParser.cs:line 231
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseNullCoalescingOperator() in /Parser/ExpressionParser.cs:line 218
at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator() in /Parser/ExpressionParser.cs:line 201
at System.Linq.Dynamic.Core.Parser.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor) in /Parser/ExpressionParser.cs:line 140
at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values) in /DynamicExpressionParser.cs:line 67
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args) in /DynamicQueryableExtensions.cs:line 2011
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args) in /DynamicQueryableExtensions.cs:line 1983
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable`1 source, String predicate, Object[] args) in /DynamicQueryableExtensions.cs:line 1989
I am using version:
I am trying to filter by enum and pass value as parameter, but I get exception
This works:
and this doesn't:
Entity source:
Callstack: