public async Task <IActionResult> Post([FromBody] CreateCourierCommand command) { if (!this.ModelState.IsValid) { return(this.BadRequest(this.ModelState)); } var response = await this._mediator.Send(command); return(this.Created(Url.RouteUrl("GetCourierById", new { id = response.Id }), new { id = response.Id })); }
public async Task <ActionResult <string> > CreateCourier(CreateCourierCommand command, CancellationToken cancellationToken) { return(Ok(await Mediator.Send(command, cancellationToken))); }