Example #1
0
        public async Task <IActionResult> GetUsers()
        {
            var users = await _repo.GetUsers();

            var usersToReturn = _mapper.Map <IEnumerable <UserForListDto> >(users);

            return(Ok(usersToReturn));
        }
Example #2
0
        public async Task <IActionResult> GetUsers(UserParams userParams)
        {
            var users = await _service.GetUsers(userParams);

            var usersReturn = _mapper.Map <IEnumerable <UserForListVM> >(users);

            Response.AddPagination(users.CurrentPage, users.PageSize, users.TotalCount, users.TotalPage);
            return(Ok(usersReturn));
        }