Chapter 7: DataContext
2 Questions with regard to the EF repository pattern presented in this book which I am in the process of implementing.
1) In the LibraryDataContext it stores (caches?) ObjectSet's of Books, BookTitles & Members. These seem to only be accessed in the relevant query translator. Why is it done this way as opposed to using FindAll()? I am guessing that creating the object set doesn't query the database, so what is the gain of doing it this way?
2) The repository used in EF has a FindAll() method which in turn calls an abstract GetObjectSet() implemented by the specific repository, but all implementations of GetObjectSet() in the example are the same - so what is the advantage of making it abstract instead of implementing it in the Repository base class?