public ActionResult <bool> AddIngredient([FromBody] IngredientResource ingredient) { _context.Add(new Ingredient { Name = ingredient.Name, Alcoholic = ingredient.Alcoholic }); var added = _context.SaveChanges(); return(added > 0); }
public IngredientResponse(IngredientResource ingredient) : this(true, string.Empty, ingredient) { }
private IngredientResponse(bool success, string message, IngredientResource category) : base(success, message) { this.Ingredient = category; }