public ActionResult <IEnumerable <Card> > Get() { try { // NOTE this should be user specific right? // var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value; return(Ok(_cs.Get())); } catch (Exception e) { return(BadRequest(e.Message)); }; }
public object Get(int?id = null, int?id_lista = null, string nome = null) { try { return(Request.CreateResponse(HttpStatusCode.OK, SelectedFields(service.Get(id, nome, id_lista), ControllerContext))); } catch (Exception) { Dictionary <string, object> erro = new Dictionary <string, object>(); erro.Add("success", false); return(Request.CreateResponse(HttpStatusCode.InternalServerError, erro)); } }
public List<Dictionary<string, object>> Get(int? id = null, string nome = null, bool card = true) { Dictionary<string, object> parametros = new Dictionary<string, object>(); parametros.Add("id", id); parametros.Add("nome", nome); List<Dictionary<string, object>> listas = DBQuery("Lista_Select", parametros, CommandType.StoredProcedure); CardsService cardService = new CardsService(); if (card) { foreach (Dictionary<string, object> lista in listas) { lista.Add("cards", cardService.Get(null, null, (int)lista["id"])); } } return listas; }
public List <Dictionary <string, object> > Get(int?id = null, string nome = null, bool card = true) { Dictionary <string, object> parametros = new Dictionary <string, object>(); parametros.Add("id", id); parametros.Add("nome", nome); List <Dictionary <string, object> > listas = DBQuery("Lista_Select", parametros, CommandType.StoredProcedure); CardsService cardService = new CardsService(); if (card) { foreach (Dictionary <string, object> lista in listas) { lista.Add("cards", cardService.Get(null, null, (int)lista["id"])); } } return(listas); }