public async Task <IActionResult> UpdateCategory([FromRoute] int categoryId, [FromBody] FoodCategoryViewModel model) { DishType dishType = model.GetDbModel(); cateringDbContext.Update(dishType); await cateringDbContext.SaveChangesAsync(); return(Ok()); }
public async Task <IActionResult> SubmitCategory([FromBody] FoodCategoryViewModel model) { DishType dishType = model.GetDbModel(); cateringDbContext.Add(dishType); await cateringDbContext.SaveChangesAsync(); return(Ok()); }