コード例 #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));
        }