public async Task <IActionResult> Get(long id)
        {
            var query = new CustomerByIdQuery(id);

            var result = await DispatchAsync(query);

            return(Ok(result));
        }
Example #2
0
        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));
        }
Example #3
0
        public async Task <IActionResult> GetById([FromQuery] CustomerByIdQuery query)
        {
            var result = await Mediator.Send(query);

            return(Ok(result));
        }