public async Task <ActionResult <ShipmentDetailViewModel> > CreateShipment([FromBody] CreateShipmentCommand newShipment) { var result = await _Mediator.Send(newShipment); var Shipment = await _Mediator.Send(new GetShipmentByIdQuery() { Id = result }); return(StatusCode(201, Shipment)); }
public async Task <IActionResult> Post([FromBody] CreateShipmentCommand command) { if (!this.ModelState.IsValid) { return(this.BadRequest(this.ModelState)); } var response = await this._mediator.Send(command); return(this.Created(Url.RouteUrl("GetShipmentById", new { id = response.Id }), new { })); }
public IActionResult CreateShipment(CreateShipmentCommand shipment) { _mediator.Send(shipment); return(Ok()); }
public IActionResult CreateShipment(CreateShipmentCommand shipment) { _mediator.Send(shipment); return(Ok("Created successfully")); }