public IActionResult Get() { // if ((new[] { "Admin" }).Contains(ValidateTokenAndRole.ValidateAndGetRole(Request), StringComparer.OrdinalIgnoreCase)) // { IEnumerable <UserModel> List = repo.GetAllAdmin().Select(User => User?.MapTo <UserModel>()); if (List.Count() == 0) { return(NotFound()); } else { return(Ok(JsonConvert.SerializeObject(List))); } // } // else return Unauthorized(); }