Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        // GET: Ranks
        public async Task <IActionResult> Index(RankSearchModel searchModel)
        {
            var model = await _rankService.ListAsync(searchModel);

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

            return(Ok(model));
        }