Пример #1
0
        public async Task ShoulFindSuccess()
        {
            CommitteeSearchCriteria criteria = new CommitteeSearchCriteria();

            var result = await _sut.Find(criteria, x => x.CommitteeType, d => d.CommitteeType);

            Assert.NotNull(result);
        }
Пример #2
0
        public async Task <QueryResult <Committee> > Find(CommitteeSearchCriteria criteria, params Expression <Func <Committee, object> >[] includes)
        {
            var res = await _context.Committees
                      .Includes(includes)
                      .WhereIf(!string.IsNullOrEmpty(criteria.CommitteeName), x => x.CommitteeName.Contains(criteria.CommitteeName))
                      .WhereIf(criteria.CommitteeTypeId != 0, x => x.CommitteeTypeId == criteria.CommitteeTypeId)
                      .WhereIf(criteria.AgencyCode != "", x => x.AgencyCode == criteria.AgencyCode)
                      .Where(x => x.IsActive.HasValue && x.IsActive.Value)
                      .OrderBy(x => x.CommitteeId)
                      .SortBy(criteria.Sort, criteria.SortDirection).ToQueryResult(criteria.PageNumber, criteria.PageSize);

            return(res);
        }
Пример #3
0
 public async Task <QueryResult <Committee> > Find(CommitteeSearchCriteria criteria)
 {
     return(await _committeeQueries.Find(criteria, x => x.CommitteeType, d => d.CommitteeType));
 }