示例#1
0
        public async Task <ActionResult <Model.Dish> > PostDish(Model.Dish dish)
        {
            _context.Dish.Add(dish);
            await _context.SaveChangesAsync();

            return(null);
        }
示例#2
0
        public async Task <ActionResult <Model.CookingTime> > PostCookingTime(Model.CookingTime cookingTime)
        {
            _context.CookingTime.Add(cookingTime);
            await _context.SaveChangesAsync();

            return(null);
        }
示例#3
0
        public async Task <ActionResult <Model.Cousine> > PostCousine(Model.Cousine cousine)
        {
            _context.Cousine.Add(cousine);
            await _context.SaveChangesAsync();

            return(null);
        }
示例#4
0
        public async Task <ActionResult <Model.Category> > PostCategory(Model.Category category)
        {
            _context.Category.Add(category);
            await _context.SaveChangesAsync();

            //return CreatedAtAction("GetCategory", new { id = category.Id }, category);
            return(null);
        }
示例#5
0
        public async Task <ActionResult <Model.Ingredient> > DeleteIngredients(int id)
        {
            var ingredients = await _context.Ingredients.FindAsync(id);

            if (ingredients == null)
            {
                return(null);
            }
            ingredients.Deleted = true;
            await _context.SaveChangesAsync();

            return(ingredients);
        }