Exemple #1
0
        public async Task <IEnumerable <RankViewModel> > RankAsync(RankSearchModel searchModel)
        {
            var data = await _unitOfWork.RankRepository.RankAsync(searchModel.PageNumber, searchModel.PageSize);

            var model = _mapper.Map <IEnumerable <RankViewModel> >(data);

            return(model);
        }
Exemple #2
0
        public async Task <IPagedList <RankViewModel> > ListAsync(RankSearchModel searchModel)
        {
            var data = await _unitOfWork.RankRepository.ListAsync(searchModel.RecordId, searchModel.PageNumber, searchModel.PageSize);

            var items = await data.ToListAsync();

            var model = _mapper.Map <IEnumerable <RankViewModel> >(items);
            var view  = new StaticPagedList <RankViewModel>(model, data.PageNumber, data.PageSize, data.TotalItemCount);

            return(view);
        }
        // GET: Ranks
        public async Task <IActionResult> Index(RankSearchModel searchModel)
        {
            var model = await _rankService.ListAsync(searchModel);

            return(View(model));
        }
        public async Task <IActionResult> Ranks(RankSearchModel searchModel)
        {
            var model = await _rankService.RankAsync(searchModel);

            return(Ok(model));
        }