2
我试图做一个IQueryable
表达如下:选择值检查
(from Person p in s
select new
{
label = p.FirstName + " "
+ (string.IsNullOrWhiteSpace(p.MiddleName) ? p.MiddleName + " " : "")
+ p.LastName,
value = p.Id
}).ToList();
我收到以下错误:
LINQ to Entities does not recognize the method 'Boolean
IsNullOrWhiteSpace(System.String)' method, and this method cannot be
translated into a store expression.
,这是什么解决办法吗?
那么我已经写了这个,但我正在寻找更简洁的东西。 – TheVillageIdiot