What would be the best way to set a gridView.DataSource for LINQ query with some foreign keys and get fields in the parent tables? Like this:
The table BOOK have a Author_Id, which is related to table Author
class:
public IQueryable<Book> ListAll()
{
RENDBDataContext db = new RENDBDataContext();
var result = from b in db.Books
orderby b.Id descending
select b;
}
code-behind:
grdBooks.DataSource = vBooks.ListAll();
grdBooks.DataBind();
In the ASPX page I can get to the Author name with the [asp:TemplateField], using <%Eval("Author.Name")%>
What I'm looking for is a better solution, that doesn't involve changes in the aspx page