예제 #1
0
 // POST api/<controller>
 public void Post([FromBody]Form newForm)
 {
     using (var db = new DDD())
     {
         db.Forms.Add(newForm);
         db.SaveChanges();
     }
 }
예제 #2
0
 // POST api/<controller>
 public void Post([FromBody] Form newForm)
 {
     using (var db = new DDD())
     {
         db.Forms.Add(newForm);
         db.SaveChanges();
     }
 }
예제 #3
0
 // PUT api/<controller>/5
 public void Put(int id, [FromBody]Form newForm)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         form.name = newForm.name;
         db.SaveChanges();
     }
 }
예제 #4
0
 // DELETE api/<controller>/5
 public void Delete(int id)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         db.Forms.Remove(form);
         db.SaveChanges();
     }
 }
예제 #5
0
 // DELETE api/<controller>/5
 public void Delete(int id)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         db.Forms.Remove(form);
         db.SaveChanges();
     }
 }
예제 #6
0
 // PUT api/<controller>/5
 public void Put(int id, [FromBody] Form newForm)
 {
     using (var db = new DDD())
     {
         var form = db.Forms.First(f => f.Id == id);
         form.name = newForm.name;
         db.SaveChanges();
     }
 }