We use LLBLGenPro version 2.6, with .Net Framework 3.5 SP1.
We wish to add RemovedEntitiesTracker collections to all collections in a deep graph. We have created a business object API that allows users to fetch the top-level object with either a shallow fetch (just the object), or a full fetch (all PrefetchPaths added).
The issue is this: in order to add the RemovedEntitiesTracker collections, we must reference the mapped entities, which causes the lazy loading logic to kick in during the "shallow fetch" use case. As a result, the benefit of lazy loading is lost, and we end up having tons of queries fire anyhow. Thus, in order to leverage both lazy loading and RemovedEntitiesTracker, we feel that we must do one of the following:
1.) Inject the addition of RemovedEntitiesTracker into the correct place in the template
OR
2.) Edit the generated entities to add the RemovedEntitiesTracker when the mapped entity collection is first fetched
Are these the only options?
EDIT:
We came up with something: what we did was modify the template for entityInclude, such that it places a User Code Region in the GetMulti() functions in our Entities for their mapped entities. This way, we can add a custom _myEntityCollection.RemovedEntitiesTracker = New MyEntityCollection(), when LLBLGen goes to load the collection for the first time. Thus, we avoid the firing of the load just because we wanted to add like so: MyEntity.MyCollection.RemovedEntitiesTracker = Foo.
Also, this works because the code generator saves our User Code Regions during refreshes.
Is this good/bad/other ?
Thanks