Exemplo n.º 1
0
        public async Task <ActionResult> GetEventsAsync(int id)
        {
            var product = await _eventStoreService.Load(id);

            var priceHistory = product.GetChanges()
                               .Where(e => e is ProductPriceUpdated)
                               .Select(e => (ProductPriceUpdated)e)
                               .Select(e => new { e.Price, e.Created });

            return(Ok(priceHistory));
        }