public Smoothie Post([FromBody] Smoothie smoothie)
 {
     if (ModelState.IsValid)
     {
         smoothie = new Smoothie(smoothie.Name, smoothie.Description, smoothie.Price);
         return(_repo.Create(smoothie));
     }
     throw new Exception("INVALID SMOOTHIE");
 }
예제 #2
0
 public Smoothie Post([FromBody] Smoothie smoothie)
 {//checks all data attributes from Burger are met
     if (ModelState.IsValid)
     {
         smoothie = new Smoothie(smoothie.Name, smoothie.Description, smoothie.Price);
         return(_repo.Create(smoothie));
     }
     throw new Exception("INVALID SMOOTHIE");
 }
예제 #3
0
 public void Put([FromBody] Smoothie smoothie)
 {
     _repo.Update(smoothie);
 }
예제 #4
0
 public Smoothie Put([FromBody] Smoothie smoothie)
 {
     return(_repo.Update(smoothie));
 }