Hi,
Apologies if this is simplistic, I'm just starting out on LLBLGen...
I have a DB structure
Account table
AccountId (PK)
ContractTypeId (from below)
... various other columns
Address table
AddressId
RelationId (will be AccountId in this example, but can be others)
... various other columns
ContractType table
ContractTypeId
Description
Account to Address is defined 1:n
Account to ContractType as 1:1
in LLBLGen
I can get an EntityCollection<AccountEntity> with the AddressEntity collection, but not the ContractType. This is the code (omitting the try-catch, .Net2):
EntityCollection<AccountEntity> accounts = null;
IPrefetchPath2 prefetchPath = new PrefetchPath2( (Int32)EntityType.AccountEntity );
prefetchPath.Add( AccountEntity.PrefetchPathContractType );
prefetchPath.Add( AccountEntity.PrefetchPathAddresses );
using ( DataAccessAdapter adaptor = new DataAccessAdapter() )
{
accounts = customer.Accounts; // customer entity defined previously
adaptor.FetchEntityCollection( accounts, customer.GetRelationInfoAccounts(), prefetchPath );
}
But AccountEntity.ContractType remains null.
Am I making some mistake here?
Rgds,
Peter