Beispiel #1
0
        public async Task <IActionResult> PostRecipe([FromForm] SaveRecipeCommand command)
        {
            command.UserId = CurrentUserId;
            await _recipeService.SaveRecipe(command);

            return(Ok());
        }
Beispiel #2
0
        public async Task SaveRecipe(SaveRecipeCommand command)
        {
            var recipe = new Recipe();

            recipe.SetRecipe(command.Name, command.Ingredients);

            await _recipeRepository.InsertRecipe(command.UserId, recipe);
        }
Beispiel #3
0
        public async Task <ActionResult> Save(SaveRecipeCommand command)
        {
            await _saveRecipeCommandHandler.HandleAsync(command);

            return(Ok());
        }