Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var model = new DeleteRecipeRequest();
                model.Id = id;
                await Mediator.Send(model);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteRecipeAsync([FromBody] DeleteRecipeRequest request)
        {
            await _mediator.Send(new DeleteRecipeCommand(request.RecipeId));

            return(NoContent());
        }