I have a table vin_info, with PK Prov, host_txn_number and Sequence. I have a Reg_info table with PK prov and host_txn_number.
Searching vin_info with a serialnumber and prov returns the correct data, but the RegInfo property is null.
Here is my code:
using (EntityCollection<VinInfoEntity> vins = new EntityCollection<VinInfoEntity>())
{
IRelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add(VinInfoFields.SerialNumber == vin.Trim());
filter.PredicateExpression.Add(VinInfoFields.Prov == prov);
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.VinInfoEntity);
prefetchPath.Add(VinInfoEntity.PrefetchPathRegInfo);
adapter.FetchEntityCollection(vins, filter, prefetchPath);
if (vins.Count > 0)
vinInfo = vins[0];
}
I have confirmed that it should return one and only one Reg_info record.
Any ideas why this doesn't work?