public async Task <IActionResult> GetRoles([FromQuery] UserParams userParams) { var currentUserId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); var userFromRepo = await _repo.GetUser(currentUserId); userParams.UserId = currentUserId; var roles = await _repo.GetRoles(userParams); var rolesToReturn = _mapper.Map <IEnumerable <RoleForListDto> >(roles); Response.AddPagination(roles.CurrentPage, roles.PageSize, roles.TotalCount, roles.TotalPages); return(Ok(rolesToReturn)); }