This question is locked. New answers and comments are not allowed.
How can I load RELATED objects without deep loading all child objects? I have attached a screen shot of my tables. My goal is query the Locale table by ID and have it load with each of the sibling objects load where the FKs that are not null. I have the following tables:
Continent
Country
State
City
Locale
The first four tables are in a parent-child relationship. The fifth table, "Locale," has FKs back to each of the other four however only ContinentID is required. Three other FK fields (CountryID, StateID, and CityID) are all nullable. Using the typical "LoadWith" is causing the entire hierarchy to load (essentially deep loading Country)
Thank you, in advance.
- Greg D.
Continent
Country
State
City
Locale
The first four tables are in a parent-child relationship. The fifth table, "Locale," has FKs back to each of the other four however only ContinentID is required. Three other FK fields (CountryID, StateID, and CityID) are all nullable. Using the typical "LoadWith" is causing the entire hierarchy to load (essentially deep loading Country)
// THIS IS NOT WORKING FOR ME ... TOO MANY OBJECTS ARE LOADING
FetchStrategy fetchStrategy =
new
FetchStrategy();
fetchStrategy.LoadWith<Country>(c => c.Continent);
fetchStrategy.LoadWith<State>(c => c.Country);
fetchStrategy.LoadWith<City>(c => c.State);
Thank you, in advance.
- Greg D.