public QueryCondition BuildConditioins(ClassPersonQuery query) { var conds = new AndQueryCondition(); if (query.ClassId.HasValue) { conds.Add(ClassPerson.CLASS_REF_FIELD, query.ClassId); } if (query.PersonId.HasValue) { conds.Add(ClassPerson.PERSON_REF_FIELD, query.PersonId); } if (query.MarkingPeriodId.HasValue) { conds.Add(ClassPerson.MARKING_PERIOD_REF, query.MarkingPeriodId); } if (query.IsEnrolled.HasValue) { conds.Add(ClassPerson.IS_ENROLLED_FIELD, query.IsEnrolled); } return(conds); }
public IList <ClassPerson> GetClassPersons(ClassPersonQuery query) { return(SelectMany <ClassPerson>(BuildConditioins(query))); }
public bool Exists(ClassPersonQuery query) { return(Exists <ClassPerson>(BuildConditioins(query))); }