Mam fragment kodu tak jak ponizej:
public IEnumerable<SelectListItem> wydawnictwa()
{
IEnumerable<SelectListItem> listaWydawnictw = _db.Wydawnictwoes.Select(c => new SelectListItem
{
Value = c.wydawnictwoId.ToString(),
Text = c.nazwa
});
return listaWydawnictw;
}
Jak dokonac tutaj konwersji na string pola wydawnictwoId (pole to jest typu Guid) ? Zastosowanie metody ToString() jak powyzej, nie wchodzi w gre, bo
LINQ to Entities does not recognize the method 'System.String ToString(System.Object)' method, and this method cannot be translated into a store expression.