A method in ASP.NET MVC is expecting an expression Expression<Func<TModel,Boolean>>
(shows a checkbox HTML control on screen), but my members are Boolean?
.
In our case, for this specific situation, null
is the same than false
, a non-checked HTML checkbox must be shown.
How may I convert from Expression<Func<TModel,Boolean?>>
to Expression<Func<TModel,Boolean>>
adding something like value = nullableValue.HasValue && nullableValue.Value
in the way?
Just remember, than the resultant Expression
must still be a MemberExpression
, what makes me wonder if this is even possible.
Cheers.