Is it possible to create IPrefetchPathElement2's with just an Entity as it's "anchor" instead of a path.
Basically, I want a class full of canned prefetches that I can just add to my queries.
i.e.
public static class CannedPrefetches
{
public static IPrefetchPathElement2 UserWithTypeAndSubType
{
get
{
IPrefetchPathElement2 _prefetchElem = UserEntity.PrefetchPathStaff; // Problem here
prefetchElem.SubPath.Add(....
prefetchElem.SubPath.Add(....
prefetchElem.SubPath.Add(....
return prefetchElem;
}
}
}
Then to use it, I can do something like
IPrefetchPath2 _prefetch = new PrefetchPath2((int)EntityType.UserEntity);
_prefetch.Add(CannedPrefetches.UserWithTypeAndSubType);
My problem is the creation of the IPrefetchPathElement2 requires a walk from one entity to the other and it "landed" on the path destination. I can't hang things with SubPath off the UserEntity in this case, only the StaffEntity.
Is there anyway to do what I want with this canned prefetch idea? Or did what I'm trying to explain even make sense?
thanks