public Task <FindCustomerByIdResponse> GetByid( [FromServices] IMediator mediator, [FromQuery] FindCustomerByIdRequest command ) { return(mediator.Send(command)); }
public CustomerDTO GetCustomerAction(Request request) { FindCustomerByIdRequest findCustomerByIdRequest = new FindCustomerByIdRequest(Int16.Parse(request.Get("id"))); Customer Customer = this.findCustomerByIdUseCase.Execute(findCustomerByIdRequest); return(this.CustomerConverter.Convert(Customer)); }
public async Task <IActionResult> GetByid( [FromServices] IMediator mediator, [FromQuery] FindCustomerByIdRequest command ) { var result = await mediator.Send(command); return(Ok(result)); }
public IActionResult GetById( [FromServices] IMediator mediator, [FromQuery] FindCustomerByIdRequest command ) { var result = mediator.Send(command); return(Ok(result)); }
public FindCustomerByIdResponse GetCustomerById(FindCustomerByIdRequest command) { var customer = _context.Customers.AsNoTracking().FirstOrDefaultAsync(x => x.Id == command.Id).Result; return(new FindCustomerByIdResponse { Id = customer.Id, Name = customer.Name, Email = customer.Email }); }
public Customer Execute(FindCustomerByIdRequest request) { CustomerId customerId = new CustomerId(request.Id); return(this.CustomerRepository.FindById(customerId)); }