public override async Task <IList <CustomerStoredEventData> > ExecuteQuery(ListCustomerStoredEventsQuery request,
                                                                               CancellationToken cancellationToken)
    {
        var storedEvents = await _storedEvents
                           .GetByAggregateId(request.CustomerId, cancellationToken);

        IList <CustomerStoredEventData> customerStoredEvents = StoredEventPrettier <CustomerStoredEventData>
                                                               .ToPretty(storedEvents);

        return(customerStoredEvents);
    }
예제 #2
0
        public async Task <IActionResult> ListEvents([FromRoute] Guid customerId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var query = new ListCustomerStoredEventsQuery(customerId);

            return(Response(await _mediator.Send(query)));
        }
    public async Task <IActionResult> ListEvents([FromRoute] Guid customerId)
    {
        var query = new ListCustomerStoredEventsQuery(customerId);

        return(await Response(query));
    }