Testing out prefetch functionality and I'm doing the following:
[Test]
public void PrefetchOrganizationPageTest()
{
int orgPageId = 0;
IPrefetchPath2 prefetch = new PrefetchPath2((int)EntityType.OrganizationPageEntity);
prefetch.Add(OrganizationPageEntity.PrefetchPathPageType).SubPath.Add(PageTypeEntity.PrefetchPathModule);
prefetch.Add(OrganizationPageEntity.PrefetchPathPageType).SubPath.Add(PageTypeEntity.PrefetchPathDashboard);
OrganizationPageEntity page = new OrganizationPageEntity(orgPageId);
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntity(page, prefetch);
However, only the last prefetch add statement is executed. It seems as the first one is skipped completely (I can comment out the second one and the first prefetch.add will work). I'm sure I'm not doing this correctly when attempting to add multiple entities to an object graph.
Just to clarify, I want to add multiple entities to the object graph
OrgPage -> PageType -> PageTypeModules (First prefetch.Add)
OrgPage -> PageType -> PageTypeDashboards (Second prefetch.Add)
Both PageTypeModules and PageTypeDashboards are mxn relations.
Thanks