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