public ActionResult <bool> ScoreUp(int id) { var score = _context.Scores.Single(s => s.DrinkId == id); _context.Scores.Update(score).Entity.Points += 1; return(_context.SaveChanges() > 0); }
public ActionResult <bool> AddIngredient([FromBody] IngredientResource ingredient) { _context.Add(new Ingredient { Name = ingredient.Name, Alcoholic = ingredient.Alcoholic }); var added = _context.SaveChanges(); return(added > 0); }