How to load table data with foreign key binding also in entity framework
2 answers
In EF4, lazy loading is enabled and enabled by default.
No such luck in previous versions: you may need to add .Include () to automatically fetch other data (load load) or call Load () on links to load it (manually).
If the lookup table said "Details", you would do ...
var featuredOffers = context.Hosters_FeaturedOffer.Include("Details").ToList();
See http://msdn.microsoft.com/en-us/library/bb896272.aspx
By the way: search for "strongly typed inclusion" - there are some extension methods people have written to remove the magic string and replace it with a lambda check time, which is compile time checked.
+4
a source to share