コード例 #1
0
        public async Task <ActionResult <Order> > PostOrder(Order order)
        {
            var command = new PostOrderCommand()
            {
                Order = order
            };

            var result = await _mediator.Send(command);

            return(CreatedAtAction("GetByOrderId", new { id = result.Id }, result));
        }
コード例 #2
0
 public async Task <ActionResult <PostOrderCommandResponse> > Post([FromBody] PostOrderCommand request)
 {
     return(await Send(request));
 }
コード例 #3
0
 public async Task <ActionResult <PostOrderCommandResponse> > Post(PostOrderCommand request, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await Send(request, cancellationToken));
 }