Пример #1
0
        protected async Task <SearchResponse <Customer> > GetItemsAsync(CustomerIndexRequest request, Expression <Func <Customer, bool> > whereClause)
        {
            var orderBy = GetOrderBy(request.SortColumn, request.IsDescending);
            var result  = await repository.GetPagedListAsync(request.Page, whereClause, orderBy);

            var response = new SearchResponse <Customer>(result.ToList(), result.TotalItemCount, result.PageSize);

            return(response);
        }
Пример #2
0
        protected override async Task <CustomerIndexResponse> GetItemsAsync(CustomerIndexRequest request)
        {
            var search = request.Search;

            Expression <Func <Customer, bool> > whereClause = r => search == null ||
                                                              search == "" ||
                                                              r.Name.Contains(search);

            var items = await GetItemsAsync(request, whereClause);

            return(new CustomerIndexResponse(items.Items, items.RecordCount, items.RowsPerPage));
        }
Пример #3
0
 public override async Task <IHttpActionResult> Index([FromUri] CustomerIndexRequest request)
 {
     return(await DoIndexAsync(request));
 }