DLinq Tutorials - Lazy Loading and Prefetching of Object Graph - DLinq Queries
- 0
- Add a Comment
Prefetching an object graph! Yes, this likely sounds like a tall order to most. But apparently once you have a grasp on the obvious, it’s really not so difficult…
Worked my way through a number of new DLinq examples to better understand querying and how to prefetch an object graph as opposed to settling for the normal lazy loading ( aka deferred loading ) of relationships. I tossed my hand built classes mentioned in the previous DLinq Tutorial ( DLinq Query Execution and Object Identity - LINQ Tutorials ), because I started getting errors when using them to prefetch part of the object graph. Obviously, I am missing some attributes, which really just proves that handcoding the DLinq Classes is crazy. You are better off using SqlMetal.exe or DLinq Designer to create your DLinq Entities. I will continue to use my DVDLibrary / Movie Library example using Genres and Movies, but I will be using the DLinq Designer generated classes as such… Source: davidhayden.com
[tags]lazy,tutorials,prefetching,object graph,queries[/tags]
