Exemple #1
0
        public async Task <IActionResult> Post([FromBody] SaveRecipeRequest input)
        {
            var createRecipeInput = new CreateRecipeInput
            {
                Description = input.Description
            };

            await _recipeService.Create(createRecipeInput);

            return(Accepted());
        }
Exemple #2
0
        public async Task <IActionResult> Put(int id, [FromBody] SaveRecipeRequest input)
        {
            var updateRecipeInput = new UpdateRecipeInput
            {
                Id          = id,
                Description = input.Description
            };

            var recipe = await _recipeService.Update(updateRecipeInput);

            return(Ok(recipe));
        }