Version 2.6 Final
Build 2.6.8.1114
Using Adapter Model
Database: MSSQL 2005
I have the following table structures:
OrgDomain
Domain
mgr_person_id
Person
person_id
last_nm
In the Designer, I have this relationship defined on the OrgDomain table:
Person (OrgDomain - Person (m:1))
Here is my code to fetch all the domains and their related managers:
EntityCollection<OrgDomainEntity> _c = new EntityCollection<OrgDomainEntity>(new OrgDomainEntityFactory());
IPrefetchPath2 _p = new PrefetchPath2((int)EntityType.OrgDomainEntity);
_p.Add(OrgDomainEntity.PrefetchPathPerson);
using (DataAccessAdapter _a = new DataAccessAdapter())
{
_a.FetchEntityCollection(_c, null, 0, null, _p);
if (_c.Count == 0 && !bExactMatch)
{
_a.FetchEntityCollection(_c, null);
}
}
When I fetch the collection, I get 10 Domain records, but the Person collection in each record is null. I have used SQL Profiler and there are 2 queries generated. One for the OrgDomain table and one for the Person table and they both return the necessary data.
What am I doing wrong?