Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public async Task <QueryResult <Committee> > Find(CommitteeSearchCriteria criteria)
 {
     return(await _committeeQueries.Find(criteria, x => x.CommitteeType, d => d.CommitteeType));
 }