我該如何重構此LINQ以使其工作?LINQ to Entities無法識別方法'System.String格式
var a = (from app in mamDB.Apps where app.IsDeleted == false
select string.Format("{0}{1}",app.AppName,
app.AppsData.IsExperimental? " (exp)": string.Empty))
.ToArray();}
我現在得到的錯誤:
LINQ to Entities does not recognize the method 'System.String Format(System.String, System.Object, System.Object)' method, and this method cannot be translated into a store expression.
我已經白白嘗試:
return (from app in mamDB.Apps where app.IsDeleted == false
select new string(app.AppName + (app.AppsData != null &&
app.AppsData.IsExperimental)? " (exp)": string.Empty)).ToArray();
http://stackoverflow.com/questions/10079990/linq-to-entities-does-not-recognize-the-method-system-string-formatsystem-stri – Thelonias