public async Task <IActionResult> Get(long id) { var query = new CustomerByIdQuery(id); var result = await DispatchAsync(query); return(Ok(result)); }
public async Task <IActionResult> Get(int id) { var query = new CustomerByIdQuery { Id = id }; var customer = await _mediator.Send(query); if (customer == null) { return(BadRequest(customer)); } return(Ok(customer)); }
public async Task <IActionResult> GetById([FromQuery] CustomerByIdQuery query) { var result = await Mediator.Send(query); return(Ok(result)); }