예제 #1
0
        public async Task <IEnumerable <QuestionViewModel> > Get(string filter, string limit = "10", string offset = "0")
        {
            int _limit, _offset = 0;

            int.TryParse(limit, out _limit);
            int.TryParse(offset, out _offset);

            return(await _questionAppService.GetAll(filter, _limit, _offset));
        }
예제 #2
0
        public async Task <ActionResult> Index()
        {
            var questions = (_questionAppService.GetAll(new PagedAndSortedResultRequestDto
            {
                MaxResultCount = int.MaxValue
            })).Items;

            var model = new QuestionListViewModel()
            {
                Questions = questions
            };

            return(View(model));
        }
예제 #3
0
        public async Task <ActionResult> Index()
        {
            HomeViewModel viewModel = new HomeViewModel
            {
                PagedResultDto = await _questionAppService.GetAll(new PagedResultRequestDto()
                {
                    MaxResultCount = 100
                }),
            };

            var user = await _userManager.GetUserByIdAsync(AbpSession.UserId.GetValueOrDefault());

            viewModel.CurrentUser = user.MapTo <UserDto>();

            return(View(viewModel));
        }
예제 #4
0
 public IEnumerable <QuestionViewModel> GetAll()
 {
     return(_questionAppService.GetAll());
 }