Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active September 23, 2020 21:41
Show Gist options
  • Save dcomartin/6dce4e3f31b7887194c5a4fd7997df14 to your computer and use it in GitHub Desktop.
Save dcomartin/6dce4e3f31b7887194c5a4fd7997df14 to your computer and use it in GitHub Desktop.
public class OrdersController : Controller
{
private readonly IAmACommandProcessor _commandProcessor;
public OrdersController(IAmACommandProcessor commandProcessor)
{
_commandProcessor = commandProcessor;
}
[HttpPost("/sales/orders/{orderId:Guid}")]
public IActionResult PlaceOrder([FromRoute]Guid orderId)
{
var request = new PlaceOrder
{
Id = Guid.NewGuid(),
OrderId = orderId,
};
_commandProcessor.Post(request);
return NoContent();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment