コード例 #1
0
        public async Task <IActionResult> GetAll()
        {
            var users = await _userService.GetAll();

            var userDtos = _mapper.Map <IList <AuthUserDto> >(users);

            return(Ok(userDtos));
        }
コード例 #2
0
 public IActionResult GetAll()
 {
     try
     {
         var authUsers = _authUserService.GetAll("Gender,Province,District");
         var result    = Mapper.Map <IEnumerable <AuthUserGetGridViewModel> >(authUsers);
         return(Ok(result));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }