Writing SQL for your applications is going far more and more, I have decided to give the unit framework a try . However, I have done something that I believe should write more code because I think it is strictly necessary.
When I reached some shipping properties, I came to know that all-one-one relation (simple reference) was weak and all one-to-many and many-to-many relations (entity code) Were empty.
For example: I have a user in context of a group when I retieved a user using a simple select ID, the group's property is zero. If I want to use the group then I have to manually load it (using User.GroupReference.Load ()) so I've added a gategroup () method to the user who checks that the group is already full Whether or not, if not, then it does so and then returns the group.
Now it will give results of very similar methods, not all navigation properties and all these innovative properties are being used, only my custom-made "property name" () method is being used now is.
I do not want to expand my questions (institutions with links) to load all of these properties immediately, because it is not always the first thing about what is needed and besides this, The cause of the questions must be.
Is there a way to configure the entity framework to load these items when they are not present? So when I'm the user Use the group and the group is not loaded yet, so it automatically loads? Or am I stuck by using my own "property name" () method, as long as I'm trying to load demands (or "bus-in-time") on objects?
Some additional information: I am using VS2008 SP1 with .NET 3.5 SP1. The unit framework I am using is the one that has been sent with it.
You can get it - This code will add transparent lazy loading support to the unit framework by changing the generator.
There is no build-in support for transparent lazy loading in Entity Framework 1.0 - using only ()
and load ()
Manual lazy loading. I'm not sure about the unit framework 2.0, but if there is no build-in support then it should be easy to add at least because of the use of code generation.
Comments
Post a Comment