// DELETE api/<controller>/5 public void Delete(int id) { using (var db = new AM234()) { Form form = db.Forms.First(f => f.Id == id); db.Forms.Remove(form); db.SaveChanges(); } }
// PUT api/<controller>/5 public void Put(int id, [FromBody] FormTo to) { using (var db = new AM234()) { Form form = db.Forms.First(f => f.Id == id); form.name = to.name; db.SaveChanges(); } }
// PUT api/<controller>/5 public void Put(int id, [FromBody]FormTo to) { using (var db = new AM234()) { Form form = db.Forms.First(f => f.Id == id); form.name = to.name; db.SaveChanges(); } }
// DELETE api/<controller>/5 public void Delete(int id) { using (var db = new AM234()) { Form form = db.Forms.First(f => f.Id == id); db.Forms.Remove(form); db.SaveChanges(); } }
// POST api/<controller> public void Post([FromBody] FormTo to) { using (var db = new AM234()) { Form form = new Form(); form.name = to.name; db.Forms.Add(form); db.SaveChanges(); } }
// POST api/<controller> public void Post([FromBody]FormTo to) { using (var db = new AM234()) { Form form = new Form(); form.name = to.name; db.Forms.Add(form); db.SaveChanges(); } }