Due to server limitations, I am limited to .Net 3.5, I used lazy booting with Linq to SQL, but have since switched to Entity Framework. L2E does not have lazy loading in 3.5, while L2S. Is there a way to restore the templates somehow to achieve this?
You must explicitly call the boot method in EF 1 / .NET 3.5.
So, before you access a related collection or entity that is not loaded, you should call something like:
Examples:
if (!person.Pets.IsLoaded) person.Pets.Load(); if (!person.Address.IsLoaded) person.Address.Load();
Of course, this is so ugly, but the way it worked in this version.
Learn more from Microsoft Blogs here:
http://blogs.microsoft.co.il/blogs/idof/archive/2008/08/20/entity-framework-and-lazy-loading.aspx
Source: https://habr.com/ru/post/1342581/More articles:Is there a standard way to add βcopy and pasteβ Javascript code to a Django project? - javascriptHow can I use JSP to create content pages with a non-JSP extension? - javajQuery: gt () inclusive - jquery"417:" Pending failed "on HTTPPost - androidHow to draw unique shortcuts on overlayitem mapview in android - androidoption (maxrecursion 0) SQL Server - sql-serverHow to set process priority in C ++ - c ++what does the assert keyword mean in java? - javaBest way to store pairs with weights for 500,000 users? - algorithmDelete view and recreate it - androidAll Articles