How to Solve linq Statement IsNullOrWhiteSpace Error

Using the IsNullOrWhiteSpace method in a linq statement will report an error,

Error message: System.NotSupportedException: ‘LINQ to Entities does not recognize the method ‘Boolean lsNullOrWhiteSpace(System.String)’ method, and this method cannot be translated into a store expression.’

You can use the method below to solve:

You can also use IsNullOrEmpty, IsNullOrEmpty method does not report an error, normal operation

The following figure is the analysis of these two methods:

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *