I have a CheckBoxFor
for a bool?
field in a view, however it is underlining it with red saying:
cannot implicitly convert bool? to bool, are you missing a cast
problem is, this is in a lambda:
bool? nullable {get; set;}
CheckBoxFor(m => m.nullable)
If it wasn't a lambda, I know I can do:
(bool)nullable
but I'm not sure how to do this in a lambda to get rid of this error. I tried to do
CheckBoxFor(m => m.nullable.value)
but this doesn't seem to be retaining its value in the controller, I'm getting a null value back.