I get an error (below) and I cant seem to convert my providerId to string
LINQ to Entities does not recognize the method 'System.String ToString(System.String)' method, and this method cannot be translated into a store expression
The resaon I am trying to convert this is because jQuery Datatables is throwing an error:
DataTables warning: table id=example2 - Requested unknown parameter '0' for row 0. For more information about this error, please see http://datatables.net/tn/4
Code:
var allProviders = _db.CareProviders.AsQueryable();
var resultItems = allProviders.Select(a => new
{
ProviderId = Convert.ToString(a.ProviderId), //convert to string
CareServiceType = a.CareServiceType,
CareServiceName = a.CareServiceName,
Email = a.Email
}).ToList();