示例#1
0
        private async Task ApplyEventsAsync(Guid id, int version, IAggregate aggregate)
        {
            if (aggregate.LastEventVersion <= version)
            {
                var events = await _eventStore.GetEventsAsync(id, aggregate.LastEventVersion + 1, version);

                aggregate.Initialize(events);
            }
        }