public IHttpActionResult GetUsers() { //IEnumerable<string> token; //Request.Headers.TryGetValues("TODO_PAGOS_TOKEN", out token); //throw new Exception(token.ToString()); try { userValidator.AtmSecure(Request); IEnumerable <User> users = userValidator.GetUsers(); List <UserDTO> listUserDTO = new List <UserDTO>(); IEnumerable <UserDTO> usersDTO; foreach (var item in users) { UserDTO userDTO = new UserDTO() { UserId = item.UserId, Name = item.Name, Admin = item.Admin, Deleted = item.Deleted, Token = item.Token, Phone = item.Phone, }; listUserDTO.Add(userDTO); } usersDTO = listUserDTO.AsEnumerable(); return(Ok(usersDTO)); } catch (NotExistException exception) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, exception.Mymessage))); } catch (System.Data.SqlClient.SqlException) { return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "VecinosUY no se puede conectar a la base de datos (∩︵∩)"))); } catch (Exception exception) { //throw new Exception(exception.Message);Luis return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exception.Message))); } }