public async Task <IActionResult> PostRecipe([FromForm] SaveRecipeCommand command) { command.UserId = CurrentUserId; await _recipeService.SaveRecipe(command); return(Ok()); }
public async Task SaveRecipe(SaveRecipeCommand command) { var recipe = new Recipe(); recipe.SetRecipe(command.Name, command.Ingredients); await _recipeRepository.InsertRecipe(command.UserId, recipe); }
public async Task <ActionResult> Save(SaveRecipeCommand command) { await _saveRecipeCommandHandler.HandleAsync(command); return(Ok()); }