Exemplo n.º 1
0
        public async Task <IActionResult> UpdateCategory([FromRoute] int categoryId, [FromBody] FoodCategoryViewModel model)
        {
            DishType dishType = model.GetDbModel();

            cateringDbContext.Update(dishType);
            await cateringDbContext.SaveChangesAsync();

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> SubmitCategory([FromBody] FoodCategoryViewModel model)
        {
            DishType dishType = model.GetDbModel();

            cateringDbContext.Add(dishType);
            await cateringDbContext.SaveChangesAsync();

            return(Ok());
        }