コード例 #1
0
 private Expression <Func <Transaction, bool> > GetPredicate(TransactionsSearchCriteria searchCriteria)
 {
     if (searchCriteria.IsFraud.HasValue && !string.IsNullOrEmpty(searchCriteria.SearchNameDest))
     {
         return((t) => t.IsFraud == searchCriteria.IsFraud &&
                t.NameDest == searchCriteria.SearchNameDest);
     }
     if (searchCriteria.IsFraud.HasValue && string.IsNullOrEmpty(searchCriteria.SearchNameDest))
     {
         return((t) => t.IsFraud == searchCriteria.IsFraud);
     }
     else
     {
         return((t) => t.NameDest == searchCriteria.SearchNameDest);
     }
 }
コード例 #2
0
 public async Task <IPagedList <Transaction> > Find(TransactionsSearchCriteria searchCriteria, int pageNumber, int pageSize)
 {
     return(await _repository.Find(GetPredicate(searchCriteria), pageNumber, pageSize));
 }