Example #1
0
        public async Task <Dish> PostDish(DishCreateRequest dish)
        {
            var dishCommand          = CreateDishCommand(dish);
            var dishTagCreateRequest = CreteDishCreateRequest(dishCommand, dish);

            await m_commandExecutor.ExecuteAsync(dishCommand);

            if (dishTagCreateRequest.TagIds != null)
            {
                await m_dishTagService.AddTagsToDish(dishTagCreateRequest);
            }
            if (dish.DishIngredients != null)
            {
                await m_dishIngredientService.AddIngredientsToDish(dishCommand.Id, dish.DishIngredients);
            }


            var postedDish = await FindDish(dishCommand.Id);

            return(postedDish);
        }
Example #2
0
 public async Task Post(DishTagCreateRequest dishTagCreateRequest)
 {
     await m_dishTagService.AddTagsToDish(dishTagCreateRequest);
 }