コード例 #1
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);
        }
コード例 #2
0
 public IngredientResponse(IngredientResource ingredient)
     : this(true, string.Empty, ingredient)
 {
 }
コード例 #3
0
 private IngredientResponse(bool success, string message, IngredientResource category)
     : base(success, message)
 {
     this.Ingredient = category;
 }