Ejemplo n.º 1
0
        private void PushOptimisticUpdate(IEventSource source, IEnumerable <ISourcedEvent> eventsToSave, IDBCollection sources)
        {
            var arrayOfEventsAsIdbObjects = GetArrayOfEventsAsIDBObjects(source, eventsToSave);

            sources.Update(new DBQuery()
            {
                { "_SourceId", source.EventSourceId.ToString() },
                { "_Version", source.InitialVersion }
            }
                           , Do.AddEachToSet("Events", arrayOfEventsAsIdbObjects
                                             ).Set("_Version", source.Version));
        }