예제 #1
0
        public async Task <OkObjectResult> Get([FromRoute] int id, CancellationToken cancellationToken)
        {
            CreateIItemDto result = await _mediator.Send(new CreateToDoItemCommand(null), cancellationToken);

            // ToDoItemQueryDto result = await _mediator.Send(new ToDoItemGetByIdQuery(new ToDoItemGetByIdSpecification(id)), cancellationToken);
            return(Ok(result));
        }
예제 #2
0
        public async Task <ActionResult <CreateIItemDto> > Post(ToDoItemResource toDoItem, CancellationToken cancellationToken)
        {
            CreateIItemDto result = await _mediator.Send(new CreateToDoItemCommand(toDoItem.Description), cancellationToken);

            return(Ok(result));
        }