This sample shows how to use code generation to add support for transparent lazy loading to Entity Framework. It includes code generator (EFLazyClassGen), supporting library (Microsoft.Data.EFLazyLoading) and sample test applications.
EFLazyClassGen generates C# code that can be used instead of object layer generated by EdmGen or Entity Framework Designer. Generated code adds support for lazy entity objects that store their data in the form of flyweight objects. Object data is initialized on first access or navigation which means objects can exist without having non-key data loaded.
http://blogs.msdn.com/jkowalski/archive/tags/EFLazyLoading/default.aspx has a series of articles that describe the library and its usage.
UPDATE: Visual Basic version of the sample is now available in the Downloads section.
Please use issue tracker on this page to report any problems and suggestions for future releases.