I have the following entity code where i want to return a formatted string based on a custom a function that return a string:
var query =
from a in db.Authors
join b in db.Books
on a.id equals b.atuhorId into ab
from item in ab.DefaultIfEmpty()
select new
{
id = a.id,
authorName= a.name,
bookName = b.name,
formatted_book = item.id != null ? model.getFormatedBook(item.id) : "N/A",
},
};
But i got an error like mentioned in my post title. Is there a cast that i can put inside my entity code for the getFormatedBook(item.id) ? I tried getFormatedBook(item.id).ToString() but with no success
Thanks