Why LINQ to Entities does not recognize the method ‘System.String ToString()?

That can’t be converted to SQL. I guess, in theory, it could, but isn’t implemented.

You just need to perform your projection after you have your results:

var pricingSecurityID = (from m in dbContext.Reporting_DailyNAV_Pricing
                                     select m.PricingSecurityID).AsEnumerable()
    .Select(x => new SelectListItem{ Text = x.ToString(), Value = x.ToString() });

Leave a Comment