Multiple Table GetMulti function

Posts   
 
    
Nimesh
User
Posts: 1
Joined: 18-Jun-2008
# Posted on: 18-Jun-2008 04:02:16   

Hi Guys, I am scratching my head around and couldn't figure out how to fetch records from multiple tables. Please help me out in this as all of my work is stopped because of this. Below is my code


GuardianCollection checkedGuardianCollection = new GuardianCollection(); RelationCollection rcGuard = new RelationCollection(); rcGuard.Add(GuardianEntity.Relations.CcbEligibilityEntityUsingGuardid); rcGuard.Add(CcbEligibilityEntity.Relations.EnrolmentEntityUsingCcbeligid); rcGuard.Add(EnrolmentEntity.Relations.AttendanceWeekEntityUsingSvcprovEnrolRef); rcGuard.Add(AttendanceWeekEntity.Relations.SessionEntityUsingSvcprovAttendRef); rcGuard.Add(SessionEntity.Relations.AttendanceWeekEntityUsingSvcprovAttendRef); rcGuard.Add(SessionEntity.Relations.CcbapprovSpaceEntityUsingApprovspcid); rcGuard.Add(CcbapprovSpaceEntity.Relations.CcbApprovalEntityUsingApprovalid); rcGuard.Add(CcbapprovSpaceEntity.Relations.ServprovSpaceEntityUsingSpaceid);


IPredicateExpression filterGuard = CommonCode.GetStdGuardianFilter(); filterGuard.AddWithAnd(ServprovSpaceFields.Id == 17); filterGuard.AddWithAnd(ServprovSpaceFields.Id == 1sunglasses ;

        sorter = new SortExpression(GuardianFields.NameFamily | SortOperator.Ascending);
        checkedGuardianCollection.GetMulti(filterGuard, 0, sorter, rcGuard);

I am damn sure that there is something wrong with my PredicateExpression filterGuard parameter. I am not sure how to get this done. Please if possible get your head around this.

Thanks,

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 18-Jun-2008 10:40:40   

I am scratching my head around and couldn't figure out how to fetch records from multiple tables. Please help me out in this as all of my work is stopped because of this. Below is my code

Option #1: Use PrefetchPaths, to fetch related records from multiple tables into a graph of entities

Option #2: Use a DynamicList or a TypedList to fetch them flattened into a dataTable.