// POST api/order public void Post([FromBody] TeslaOrder order) { //in real world inject the bus //this is creating connection to the rabbit mq var messageBus = RabbitHutch.CreateBus("host=localhost"); messageBus.Publish(order); }
public IActionResult Post([FromBody] TeslaOrder order) { using (var bus = RabbitHutch.CreateBus("host=localhost")) { bus.Publish(order); } return(Ok()); }
public IActionResult Get([FromQuery] TeslaOrder order) { return(Ok(new { id = 5 })); }