示例#1
0
        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);
        }
示例#2
0
 public IList <ClassPerson> GetClassPersons(ClassPersonQuery query)
 {
     return(SelectMany <ClassPerson>(BuildConditioins(query)));
 }
示例#3
0
 public bool Exists(ClassPersonQuery query)
 {
     return(Exists <ClassPerson>(BuildConditioins(query)));
 }