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.

Read more about 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 Apr 16 2010 at 1:00 AM  by jkowalski, version 7
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

kevinlyons wrote  Nov 12 2010 at 12:07 AM  
I know this comment is extremely old, but I had the same problem and here is how I solved it.
Wrap the statements in your pre-build with quotes.
"$(SolutionDir)Sources\EFLazyClassGen\bin\$(Configuration)\EFLazyClassGen.exe" "$(ProjectDir)NorthwindEF.edmx" "$(ProjectDir)NorthwindEF.Designer.cs"

In case your wondering why I'm still using VS2008, well because some companies just don't upgrade to the latest version of software, if ever!

arielsrv wrote  Mar 29 2011 at 8:31 PM  
The solution can't build.

Nasar wrote  Jan 18 2012 at 12:12 PM  
I am facing same build error, please help..

Page view tracker