コード例 #1
0
            public async Task <Unit> Handle(ChangeRecipeStatusCommand request, CancellationToken cancellationToken)
            {
                Recipe recipe = await RecipeRepository.GetRecipeById(request.RecipeId, cancellationToken);

                if (request.Active)
                {
                    recipe.Activate();
                }
                else
                {
                    recipe.Deactivate();
                }

                await RecipeRepository.Save(recipe, cancellationToken);

                return(new Unit());
            }