// POST: api/Bebida public string Post([FromBody] dados_bebida bebida) { using (pro_chef_webEntities bd = new pro_chef_webEntities()) { bd.dados_bebida.Add(bebida); bd.SaveChanges(); return("Salvo com sucesso"); } }
// PUT: api/Bebida/5 public string Put(int id, [FromBody] dados_bebida bebida) { using (pro_chef_webEntities bd = new pro_chef_webEntities()) { dados_bebida bebidaAlterar = bd.dados_bebida.Find(id); bebidaAlterar.bebida = bebida.bebida; bd.SaveChanges(); return("Salvo com sucesso"); } }