Làm cách nào tôi có thể tái cấu trúc LINQ này để thực hiện công việc này?LINQ to Entities không nhận ra phương thức 'System.String Format
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();}
bây giờ tôi nhận được lỗi:
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.
Tôi đã vô ích thử:
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