Search Wiki:
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.
Last edited May 21 at 5:42 PM  by jkowalski, version 6
Comments
bcumminsr wrote  Aug 18 2008 at 9:04 PM  
Getting this error when building solution "Error 1 The command "C:\My Documents\Visual Studio 2008\Projects\Entity Framework Samples\EFLazyLoading\EFLazyLoading\\Sources\EFLazyClassGen\bin\Debug\EFLazyClassGen.exe C:\My Documents\Visual Studio 2008\Projects\Entity Framework Samples\EFLazyLoading\EFLazyLoading\Tests\DesignerTest\NorthwindEF.edmx C:\My Documents\Visual Studio 2008\Projects\Entity Framework Samples\EFLazyLoading\EFLazyLoading\Tests\DesignerTest\NorthwindEF.Designer.cs" exited with code 9009. DesignerTest" Can anyone assist? Thanks

Updating...
Page view tracker