by joe.pesch
27. December 2011 15:54
LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression.
One workaround for this is to convert the LINQ to Entities object to a LINQ to Objects object by adding .AsEnumerable() as in the sample below.
var qry = from itm in obj.Booksheets.AsEnumerable()
where bks.Purchases.FirstOrDefault() == null
select new
{
FormattedPrice = bks.WebPrice.ToString("#,###"),
};
97b064b5-be47-4b95-b897-877b4b135d39|3|3.3|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
LINQ | LINQ to Entities