在 linq 语句中使用 IsNullOrWhiteSpace方法会报错,
错误信息: System.NotSupportedException: 'LINQ to Entities does not recognize themethod 'Boolean lsNullOrWhiteSpace(System.String)' method, and this methodcannot be translated into a store expression.'
可以使用下图的方法解决:
也可以用IsNullOrEmpty,使用IsNullOrEmpty方法居然不报错,正常运行
下图是这两个方法的解析