Hello
I have the following table structure
Site-joinsToMany-> Assembly
Assembly-joinsToMany->Antenna
Assembly-joinsToMany->Component
Assembly-joinsToMany->Device
Basically I am pulling a Site and I would like to get all Assemblies, Antennas, Components, and Devices for that one site. I tried two pieces of code that did not work.
This one gives me the problem when fetching, since PrefetchPathComponent is not part of SiteEntity.
PrefetchPath2 siteAndChildren = new PrefetchPath2((int)EntityType.SiteEntity);
siteAndChildren.Add(SiteEntity.PrefetchPathAssembly).SubPath.Add(AssemblyEntity.PrefetchPathAntenna);
siteAndChildren.Add(AssemblyEntity.PrefetchPathComponent);
siteAndChildren.Add(AssemblyEntity.PrefetchPathDevice);
And this one gives me the error that the path already exists when running:
PrefetchPath2 siteAndChildren = new PrefetchPath2((int)EntityType.SiteEntity);
siteAndChildren.Add(SiteEntity.PrefetchPathAssembly).SubPath.Add(AssemblyEntity.PrefetchPathAntenna);
siteAndChildren.Add(SiteEntity.PrefetchPathAssembly).SubPath.Add(AssemblyEntity.PrefetchPathComponent);
siteAndChildren.Add(SiteEntity.PrefetchPathAssembly).SubPath.Add(AssemblyEntity.PrefetchPathDevice);
Is there a way to pull these records starting from Site? I understand that I could pull Assemblies and basicaly prefetch all the others, unfortunatelly my code uses sites as base to travel.
Thank you,
Bruno Valle