使用Ef查询出现的问题The cast to value type 'System.Boolean' failed because the materialized value is null.的解决方法

使用Ef查询出现的问题The cast to value type 'System.Boolean' failed because the materialized value is null.的解决方法

结果类型的泛型参数或查询必须使用可空类型。

解决方法:

请确保你查询中的字段值不为空或者做为空判断