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"); }
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"); }
public void Put([FromBody] Smoothie smoothie) { _repo.Update(smoothie); }
public Smoothie Put([FromBody] Smoothie smoothie) { return(_repo.Update(smoothie)); }