Exemplo n.º 1
0
        public IActionResult Index(Guid tripId)
        {
            EnsureArg.IsNotEmpty(tripId);
            var query       = new GetTripByIdQuery(tripId);
            var queryResult = QueryDispatcher.Execute <GetTripByIdQuery, GetTripByIdQueryResult>(query);

            return(Ok(queryResult.Trip));
        }
Exemplo n.º 2
0
        public Task <SingleTripQueryResponse> Handle(GetTripByIdQuery request, CancellationToken cancellationToken)
        {
            Trip trip     = _repo.GetTripById(request.TripId);
            var  response = new SingleTripQueryResponse(trip);

            response.Status = GetResponseStatus(trip);
            return(Task.FromResult(response));
        }
        public async Task <SingleTripQueryResponse> GetTripById(TravelUser user, int TripId)
        {
            var query = new GetTripByIdQuery(user, TripId);

            return(await _mediator.Send(query));
        }