Just upgraded to llblgenpro 2004.2. Regenerated the code, recompiled my project, updated the llblgen dlls to the new version and everything built fine. However when I try and execute the project, I get the following error. "The PrefetchPathElement you to tried to add is already added to this PrefetchPath. Parameter name: elementToAdd ".
Code I have is as follows which worked in the previous version:
public static OrganizationPageEntity GetPrefetchOrganizationPage(int organizationPageId)
{
IPrefetchPath2 prefetch = new PrefetchPath2((int)EntityType.OrganizationPageEntity);
IPrefetchPathElement2 pageTypeNode = prefetch.Add(OrganizationPageEntity.PrefetchPathPageType);
pageTypeNode.SubPath.Add(PageTypeEntity.PrefetchPathPageTypeModuleSetting);
pageTypeNode.SubPath.Add(PageTypeEntity.PrefetchPathPageTypeDashboardSetting);
prefetch.Add(pageTypeNode);
OrganizationPageEntity organizationPage = new OrganizationPageEntity(organizationPageId);
DataAccessAdapter adapter = new DataAccessAdapter();
try
{
adapter.FetchEntity(organizationPage, prefetch);
return organizationPage;
}
finally
{
adapter.CloseConnection();
}
}
Any possible insight into what I'm doing wrong would be appreciated. Thanks.
Stack Trace:
[ArgumentException: The PrefetchPathElement you to tried to add is already added to this PrefetchPath.
Parameter name: elementToAdd]
SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPath2.Add(IPrefetchPathElement2 elementToAdd, Int32 maxAmountOfItemsToReturn, IPredicateExpression additionalFilter, IRelationCollection additionalFilterRelations, ISortExpression additionalSorter, IEntityFactory2 entityFactoryToUse) +467
SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPath2.Add(IPrefetchPathElement2 elementToAdd) +17
Guidanceware.Application.Bll.Managers.OrganizationPageManager.GetPrefetchOrganizationPage(Int32 organizationPageId) in c:\documents and settings\eric richards\my documents\work\guidanceware\guidanceware\application\bll\managers\organizationpagemanager.cs:112
Guidanceware.Application.Bll.Managers.UserSettingsManager..ctor(Int32 appId, Int32 pageId, Int32 userId, Int32 companyId) in C:\Documents and Settings\Eric Richards\My Documents\work\Guidanceware\guidanceware\Application\bll\UserSettingsManager.cs:97
WebApp.Global.Application_BeginRequest(Object sender, EventArgs e) in C:\Documents and Settings\Eric Richards\My Documents\work\Guidanceware\guidanceware\Global.asax.cs:69
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +8