Exemplo n.º 1
0
        public async Task <IEnumerable <IVehicleMakeDomain> > GetAllMakesAsync(Sorting sorting, Searching searching, PaginatedList <VehicleMake> paging)
        {
            SortBy   sortBy   = new SortBy();
            SearchBy searchBy = new SearchBy();
            Func <IQueryable <VehicleMake>, IOrderedQueryable <VehicleMake> > sort = sortBy.MakeOrderBy(sorting.SortString);

            if (!String.IsNullOrWhiteSpace(searching.SearchingString))
            {
                Expression <Func <VehicleMake, bool> > search = searchBy.MakeSearchBy(searching.SearchingString);
                return(_mapper.Map <IEnumerable <IVehicleMakeDomain> >(await base.GetAllAsync(sort, paging, search)));
            }

            else
            {
                return(_mapper.Map <IEnumerable <IVehicleMakeDomain> >(await base.GetAllAsync(sort, paging)));
            }
        }