예제 #1
0
        public async Task <IActionResult> GetAllAsync()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Not valid data"));
            }

            var usersDTO = (await _userService.GetUsersAsync()).OrderByDescending(u => u.RoleId).ThenBy(u => u.FirstName);

            var users = UserMapper.ConvertToUserViewModelCollection(usersDTO);

            return(Ok(users));
        }