February 2010
Beginner
400 pages
11h 13m
English
In previous versions of EF, foreign key fields on entities were hidden from the developer in the generated model. Developers were expected to access the related entity directly instead of querying foreign key fields. This could mean making some additional database queries to join entities and writing some tedious code.
For example, in our code we might be creating a UI for managing FilmShowings. It would be a lot easier if when creating a new film showing we could just set the related FilmID property:
NewFilmShowing.FilmID = FilmID;
In EF4, you can. It may be worth questioning whether you should be working this way, but I think on the whole it avoids additional database queries.
One of the biggest ...