public IActionResult Get() { var res = new Dictionary <string, Object>(); var rolServ = new RolService(); try { res.Add("roles", rolServ.GetRoles()); return(Ok(res)); } catch (Exception e) { if (e is NotFoundException) { res.Add("message", e.Message); return(NotFound(res)); } else { res.Add("message", "Error en el servidor"); return(StatusCode(500, res)); } } }