예제 #1
0
        public Task AppendToStream(string streamId, int expectedVersion, params EventData[] events)
        {
            Guard.IsNotNullOrEmpty(nameof(streamId), streamId);

            var storageEvents = new List <StorageEvent>();
            var eventVersion  = expectedVersion;

            for (var i = 0; i < events.Length; i++)
            {
                storageEvents.Add(new StorageEvent(streamId, events[i], ++eventVersion));
            }

            return(engine.AppendToStream(streamId, storageEvents));
        }