public RepositoryScenarioBuilder()
 {
     _eventStore = Wireup.Init().UsingInMemoryPersistence().Build();
     _unitOfWork = new UnitOfWork();
     _eventStoreSchedule = new List<Action<IStoreEvents>>();
     _unitOfWorkSchedule = new List<Action<UnitOfWork>>();
 }
Exemplo n.º 2
0
        public static Core UseNEventStore(this Core core, IStoreEvents nEventStore)
        {
            if (core.GetContainer().Model.HasImplementationsFor<IEventStore>())
            {
                throw new EventStoreAlreadyConfiguredException();
            }

            try
            {
                core.GetContainer()
                    .Configure(
                        expression =>
                        expression.For<IEventStore>()
                                  .Singleton()
                                  .Use<NEventStore>()
                                  .Ctor<IStoreEvents>()
                                  .Is(nEventStore));
            }
            catch (Exception)
            {
                throw new Exception("Failed to execute wireup for event store.");
            }

            return core;
        }
Exemplo n.º 3
0
 public Rebuild(IStoreEvents eventStore, IDomainUpdateServiceBusHandlerHook hook, ILifetimeScope container, IMongoContext mongo)
 {
     _eventStore = eventStore;
     _hook = hook;
     _container = container;
     _mongo = mongo;
 }
Exemplo n.º 4
0
 public Program(IMessageSender sender, IStoreEvents store, NuclearStorage storage)
 {
     this.sender = new SenderDecorator(sender);
     this.store = store;
     this.storage = storage;
     reader = new ConsoleReader();
 }
Exemplo n.º 5
0
 public void SetUp()
 {
     streamId = Guid.NewGuid().ToString();
     store = TestEventStore.Create();
     store.Populate(streamId);
     stream =  NEventStoreStream.ByAggregate(store, streamId);
 }
Exemplo n.º 6
0
 public EventsReplayer(IStoreEvents store, IBus bus)
 {
     Contract.Requires<ArgumentNullException>(store != null, "store");
     Contract.Requires<ArgumentNullException>(bus != null, "bus");
     _store = store;
     _bus = bus;
 }
Exemplo n.º 7
0
        public static void Init()
        {
            StoreEvents = Wireup.Init()
                //.UsingInMemoryPersistence()
                .UsingSqlPersistence("EventStore") // Connection string is in app.config
                .WithDialect(new PostgreSqlDialect())
                .EnlistInAmbientTransaction() // two-phase commit
                .InitializeStorageEngine()
                //.TrackPerformanceInstance("example")
                .UsingJsonSerialization()
                //.Compress()
                //.EncryptWith(EncryptionKey)
                //.HookIntoPipelineUsing(new[] { new AuthorizationPipelineHook() })
                //.UsingSynchronousDispatchScheduler()
                //.DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
                .Build();


            var connectionString = ConfigurationManager.ConnectionStrings["EventStore"].ConnectionString;
            var connection = new NpgsqlConnection(connectionString);
            connection.Open();

            var sql = @"
CREATE TABLE IF NOT EXISTS ""LigaView"" 
(
   ""Id"" uuid NOT NULL,
   ""Name"" varchar NOT NULL
);";
            connection.Execute(sql);

            connection.Close();
        }
        public void SetUp()
        {
            // populate the event store
            store = TestEventStore.Create();

            streamSource = new NEventStoreStreamSource(store);
        }
 public LegacySnapshotCreator(IStoreEvents store, IDatabase database)
 {
     Contract.Requires<ArgumentNullException>(store != null, "store");
     Contract.Requires<ArgumentNullException>(database != null, "database");
     _store = store;
     _db = database;
 }
 public Persistence()
 {
     using (var scope = new TransactionScope())
     {
         store = WireupEventStore();
     }
     this.setConnection(true);
 }
Exemplo n.º 11
0
        public NEventStore(IStoreSettings<IStoreEvents> settings, IServiceBus serviceBus)
        {
            _settings = settings;
            _serviceBus = serviceBus;

            _store = _settings.GetConnection();
            _eventStream = _store.OpenStream("main");
        }
Exemplo n.º 12
0
 public LessonMigration(IDatabase database, IStoreEvents storeEvent)
 {
     Contract.Requires<ArgumentNullException>(database != null, "database");
     Contract.Requires<ArgumentNullException>(storeEvent != null, "storeEvent");
     _db = database;
     _store = storeEvent;
     _logs = new List<string>();
 }
 public RebuildSnapshotTask(ILogger log, IStoreEvents events, IRepository repository)
 {
     if (log == null) throw new ArgumentNullException("log");
     if (events == null) throw new ArgumentNullException("events");
     if (repository == null) throw new ArgumentNullException("repository");
     this.log = log;
     this.events = events;
     this.repository = repository;
 }
 protected override void Context()
 {
     _dummyDispatchCommits = new DummyDispatchCommits();
     _eventStore = Wireup
         .Init()
         .UsingInMemoryPersistence()
         .DoNotDispatchCommits()
         .Build();
 }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            store = Wireup.Init()
                .With<ISerialize>(new JsonPayloadSerializer())
                .UserSimpleDataPersistenceEngine("SD_ES")
                .Build();

            LoadTest();
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of <see cref="EventDispatcher"/>.
        /// </summary>
        /// <param name="eventStore">The event store.</param>
        /// <param name="eventPublisher">The event publisher.</param>
        /// <param name="settings">The current event store settings.</param>
        internal EventDispatcher(IStoreEvents eventStore, IPublishEvents eventPublisher, IStoreEventSettings settings)
        {
            Verify.NotNull(eventStore, nameof(eventStore));
            Verify.NotNull(eventPublisher, nameof(eventPublisher));

            this.eventStore = eventStore;
            this.eventPublisher = eventPublisher;
            this.markDispatched = settings.MarkDispatched;
        }
 protected override void Context()
 {
     _dummyDispatchCommits = new DummyDispatchCommits();
     _eventStore = Wireup
         .Init()
         .UsingInMemoryPersistence()
         .UsingAsynchronousDispatchScheduler(_dummyDispatchCommits)
         .Build();
 }
Exemplo n.º 18
0
        public static void Show(IStoreEvents store)
        {
            eventStore = store;

            OpenOrCreateStream();
            AppendToStream();
            TakeSnapshot();
            LoadFromSnapshotForwardAndAppend();
        }
        public SourceStore()
        {
            //TODO: Setup your source store here
            _store = Wireup.Init().UsingInMemoryPersistence().InitializeStorageEngine().Build();

            //Uncomment if you want to add some test data
            //CreateTestStream();

            _commits = _store.Advanced.GetFrom(DateTime.MinValue).GetEnumerator();
        }
Exemplo n.º 20
0
        public void Setup()
        {
            BsonClassMap.RegisterClassMap<InventoryItemCreated>();
            BsonClassMap.RegisterClassMap<InventoryItemStocked>();

            _store = Wireup.Init()
                .UsingMongoPersistence("demo", new DocumentObjectSerializer())
                .InitializeStorageEngine()
                .Build();
        }
        public MongoEventReplayer(Type eventType, IEnumerable<Handles<IEvent>> eventHandlerInstances, IStoreEvents eventStore, MongoDatabase readModelDatabase)
        {
            if (eventType == null) throw new ArgumentNullException("eventType");
            if (eventStore == null) throw new ArgumentNullException("eventStore");
            if (readModelDatabase == null) throw new ArgumentNullException("readModelDatabase");

            _eventHandlerInstances = eventHandlerInstances;
            _eventStore = eventStore;
            _readModelDatabase = readModelDatabase;
        }
Exemplo n.º 22
0
		public DenormalizerRebuilder(IDenormalizerCatalog catalog, IDenormalizersHashesStore hashesStore,
			IHashcodeGenerator hashcodeGenerator, IDomainEventHandlerCatalog domainEventCatalog, IStoreEvents eventStore, ILogger logger)
		{
			_catalog = catalog;
			_eventStore = eventStore;
			_hashcodeGenerator = hashcodeGenerator;
			_domainEventHandlerCatalog = domainEventCatalog;
			_denormalizersHashesStore = hashesStore;
			_logger = logger;
		}
Exemplo n.º 23
0
 public LoginCommand()
 {
     var test = new CommitDispatcher();
     _store = Wireup.Init()
         .UsingRavenPersistence("RavenDb")
         .InitializeStorageEngine()
         .UsingSynchronousDispatchScheduler()
         .DispatchTo(test)
         .Build();
 }
        public void CanBuildStore()
        {
            Directory.CreateDirectory(_Directory);

            _Store = Wireup.Init()
                           .UsingDiskStoragePersistence(_Directory)
                           .InitializeStorageEngine()
                           .UsingSynchronousDispatchScheduler(
                               new DelegateMessageDispatcher((commit) => { LastCommit = commit.CommitId; }))
                           .Build();
        }
 public EventStreamController(
     IStoreEvents eventStore, 
     ICommitEnhancer enhancer,
     IHandleMapper handleMapper,
     IIdentityConverter identityConverter)
 {
     _enhancer = enhancer;
     _commits = (ICommitEvents)eventStore;
     _handleMapper = handleMapper;
     _identityConverter = identityConverter;
 }
 protected override void Context()
 {
     _dummyDispatchCommits = new DummyDispatchCommits();
     _eventStore = Wireup
         .Init()
         .UsingInMemoryPersistence()
         .UsingSynchronousDispatchScheduler()
             .DispatchTo(_dummyDispatchCommits)
             .Startup(DispatcherSchedulerStartup.Explicit)
         .Build();
 }
Exemplo n.º 27
0
 public JoesUnitOfWork(Guid commandId, IDomainRepository domainRepository, IStoreEvents eventStore, ISnapshotStore snapshotStore, IEventBus eventBus, ISnapshottingPolicy snapshottingPolicy)
     : base(commandId)
 {
     _eventStream = new UncommittedEventStream(commandId);
     _commitId = commandId;
     _eventStore = eventStore;
     _domainRepository = domainRepository;
     _snapshotStore = snapshotStore;
     _eventBus = eventBus;
     _snapshottingPolicy = snapshottingPolicy;
 }
Exemplo n.º 28
0
 public MongoDBEventStore(IEventBus bus)
 {
     if (bus == null) throw new ArgumentNullException("bus");
     _bus = bus;
     _store = Wireup.Init()
                    .LogToOutputWindow()
                    .UsingMongoPersistence("Mongo", new DocumentObjectSerializer())
                    .InitializeStorageEngine()
                    .UsingSynchronousDispatchScheduler(this)
                    .Build();
 }
Exemplo n.º 29
0
        public void SetUp()
        {
            // populate the event store
            store = TestEventStore.Create();

            streamId = Guid.NewGuid().ToString();

            store.WriteEvents(streamId);

            stream = NEventStoreStream.ByAggregate(store, streamId).DomainEvents();
        }
Exemplo n.º 30
0
        public EventStoreRecordStorage(IIdentity identity, IStoreEvents storage, ILogger logger)
        {
            if (storage == null)
                throw new ArgumentException("storage");

            m_identity = identity;
            m_storage = storage;
            m_logger = logger;

            if (!Guid.TryParse(identity.GetIdenfitier(), out m_streamID))
                throw new DomainException("Identity can not be converted to guid. Identity id: {0}", m_identity.GetIdenfitier());
        }
Exemplo n.º 31
0
 /// <summary>
 /// Create `NEventStore` implementation of `IOutbox`.
 /// </summary>
 /// <param name="eventStore">NEventStore instance</param>
 /// <param name="receptionDelay">
 /// It should include transaction timeout + clock drift.
 /// Otherwise, it may skip events during reception.
 /// </param>
 public NEventStoreOutbox(IStoreEvents eventStore, TimeSpan receptionDelay)
 {
     _eventStore     = eventStore;
     _receptionDelay = receptionDelay;
 }
Exemplo n.º 32
0
 /// <summary>
 ///     Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream to be created.</param>
 /// <returns>An empty stream.</returns>
 public static IEventStream CreateStream(this IStoreEvents storeEvents, Guid streamId)
 {
     return(CreateStream(storeEvents, Bucket.Default, streamId));
 }
Exemplo n.º 33
0
 /// <summary>
 ///     Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="bucketId">The value which uniquely identifies bucket the stream belongs to.</param>
 /// <param name="streamId">The value which uniquely identifies the stream within the bucket to be created.</param>
 /// <returns>An empty stream.</returns>
 public static IEventStream CreateStream(this IStoreEvents storeEvents, string bucketId, Guid streamId)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.CreateStream(bucketId, streamId.ToString()));
 }
Exemplo n.º 34
0
        protected Projector(
            ILogger <TProject> logger,
            IStoreEvents events,
            TProject process,
            int batchSize,
            TimeSpan timeout)
        {
            _logger = logger;
            _events = events;
            _timer  = new Timer(time => {
                _batch.TriggerBatch();
            });
            _queue   = new BufferBlock <Envelope>();
            _trigger = new TransformBlock <Envelope, Envelope>(
                envelope => {
                _timer.Change(timeout, Timeout.InfiniteTimeSpan);
                return(envelope);
            }
                );
            _batch   = new BatchBlock <Envelope>(batchSize);
            _process = new TransformBlock <Envelope[], ProjectionResult[]>(async envelopes => {
                var time = DateTime.Now;
                try {
                    var results = new ProjectionResult[envelopes.Length];

                    for (var i = 0; i < envelopes.Length; i++)
                    {
                        results[i] = new ProjectionResult {
                            Envelope   = envelopes[i],
                            Projection = await process.Project(envelopes[i]),
                        };
                    }

                    return(results);
                } finally {
                    _logger.LogDebug($"Processed {envelopes.Length} events in {(DateTime.Now - time).TotalMilliseconds}ms");
                }
            });
            _commit = new ActionBlock <ProjectionResult[]>(async envelopes => {
                _timer.Change(Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan);

                var time = DateTime.Now;
                try {
                    await Commit(envelopes);
                } finally {
                    _logger.LogInformation($"Committed {envelopes.Length} projections in {(DateTime.Now - time).TotalMilliseconds}ms");
                }
            });

            _queue.LinkTo(_trigger, new DataflowLinkOptions {
                PropagateCompletion = true
            });
            _trigger.LinkTo(_batch, new DataflowLinkOptions {
                PropagateCompletion = true
            });
            _batch.LinkTo(_process, new DataflowLinkOptions {
                PropagateCompletion = true
            });
            _process.LinkTo(_commit, new DataflowLinkOptions {
                PropagateCompletion = true
            });
        }
Exemplo n.º 35
0
 /// <summary>
 ///     Reads the stream indicated from the minimum revision specified up to the maximum revision specified or creates
 ///     an empty stream if no commits are found and a minimum revision of zero is provided.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="bucketId">The value which uniquely identifies bucket the stream belongs to.</param>
 /// <param name="streamId">The value which uniquely identifies the stream within the bucket to be created.</param>
 /// <param name="minRevision">The minimum revision of the stream to be read.</param>
 /// <param name="maxRevision">The maximum revision of the stream to be read.</param>
 /// <returns>A series of committed events represented as a stream.</returns>
 /// <exception cref="StorageException" />
 /// <exception cref="StorageUnavailableException" />
 /// <exception cref="StreamNotFoundException" />
 public static IEventStream OpenStream(this IStoreEvents storeEvents, string bucketId, Guid streamId, int minRevision = int.MinValue, int maxRevision = int.MaxValue)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.OpenStream(bucketId, streamId.ToString(), minRevision, maxRevision));
 }
Exemplo n.º 36
0
 /// <summary>
 /// Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="bucketId">The value which uniquely identifies bucket the stream belongs to.</param>
 /// <param name="streamId">The value which uniquely identifies the stream within the bucket to be created.</param>
 /// <param name="cancellationToken"></param>
 /// <returns>An empty stream.</returns>
 public static Task <IEventStream> CreateStreamAsync(this IStoreEvents storeEvents, string bucketId, Guid streamId, CancellationToken cancellationToken)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.CreateStreamAsync(bucketId, streamId.ToString(), cancellationToken));
 }
Exemplo n.º 37
0
 /// <summary>
 /// Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream to be created.</param>
 /// <param name="cancellationToken"></param>
 /// <returns>An empty stream.</returns>
 public static Task <IEventStream> CreateStreamAsync(this IStoreEvents storeEvents, string streamId, CancellationToken cancellationToken)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.CreateStreamAsync(Bucket.Default, streamId, cancellationToken));
 }
Exemplo n.º 38
0
 /// <summary>
 /// Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream to be created.</param>
 /// <param name="cancellationToken"></param>
 /// <returns>An empty stream.</returns>
 public static Task <IEventStream> CreateStreamAsync(this IStoreEvents storeEvents, Guid streamId, CancellationToken cancellationToken)
 {
     return(CreateStreamAsync(storeEvents, Bucket.Default, streamId, cancellationToken));
 }
 public ReadFromStreamBenchmarks()
 {
     _eventStore = EventStoreHelpers.WireupEventStore();
 }
Exemplo n.º 40
0
 public PersistenceBenchmarks()
 {
     _eventStore = EventStoreHelpers.WireupEventStore();
 }
 /// <summary>
 /// Please do not dispose of <c>store</c> This implementation will take care of its disposal.
 /// </summary>
 /// <param name="store"></param>
 public NEventStoreImplementation(IStoreEvents store)
 {
     _store = store;
 }
Exemplo n.º 42
0
 /// <summary>
 ///     Reads the stream indicated from the minimum revision specified up to the maximum revision specified or creates
 ///     an empty stream if no commits are found and a minimum revision of zero is provided.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream from which the events will be read.</param>
 /// <param name="minRevision">The minimum revision of the stream to be read.</param>
 /// <param name="maxRevision">The maximum revision of the stream to be read.</param>
 /// <returns>A series of committed events represented as a stream.</returns>
 /// <exception cref="StorageException" />
 /// <exception cref="StorageUnavailableException" />
 /// <exception cref="StreamNotFoundException" />
 public static IEventStream OpenStream(this IStoreEvents storeEvents, string streamId, int minRevision = int.MinValue, int maxRevision = int.MaxValue)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.OpenStream(Bucket.Default, streamId, minRevision, maxRevision));
 }
Exemplo n.º 43
0
 public NEventStoreUnitOfWorkCommitter(IStoreEvents eventStore, ConflictsWithDelegate conflictDetector, DetermisticGuidDelegate determisticGuid)
 {
     _eventStore       = eventStore;
     _conflictDetector = conflictDetector;
     _determisticGuid  = determisticGuid;
 }
Exemplo n.º 44
0
 public SagaEventStoreRepository(IStoreEvents eventStore)
 {
     this.eventStore = eventStore;
 }
Exemplo n.º 45
0
 /// <summary>
 /// Reads the stream indicated from the minimum revision specified up to the maximum revision specified or creates
 /// an empty stream if no commits are found and a minimum revision of zero is provided.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream from which the events will be read.</param>
 /// <param name="cancellationToken"></param>
 /// <param name="minRevision">The minimum revision of the stream to be read.</param>
 /// <param name="maxRevision">The maximum revision of the stream to be read.</param>
 /// <returns>A series of committed events represented as a stream.</returns>
 /// <exception cref="StorageException" />
 /// <exception cref="StorageUnavailableException" />
 /// <exception cref="StreamNotFoundException" />
 public static Task <IEventStream> OpenStreamAsync(this IStoreEvents storeEvents, Guid streamId, CancellationToken cancellationToken, int minRevision = int.MinValue, int maxRevision = int.MaxValue)
 {
     return(OpenStreamAsync(storeEvents, Bucket.Default, streamId, cancellationToken, minRevision, maxRevision));
 }
Exemplo n.º 46
0
 public EventStoreAdapter(IStoreEvents eventStore)
 {
     _eventStore = eventStore;
 }
Exemplo n.º 47
0
 public NEventStoreAdapter(IStoreEvents storeEvents, IConstructAggregates aggregateFactory = null)
 {
     m_StoreEvents = storeEvents;
     Repository    = new EventStoreRepository(storeEvents, aggregateFactory ?? new AggregateFactory(), new ConflictDetector());
 }
Exemplo n.º 48
0
 /// <summary>
 /// Reads the stream indicated from the minimum revision specified up to the maximum revision specified or creates
 /// an empty stream if no commits are found and a minimum revision of zero is provided.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="bucketId">The value which uniquely identifies bucket the stream belongs to.</param>
 /// <param name="streamId">The value which uniquely identifies the stream within the bucket to be created.</param>
 /// <param name="cancellationToken"></param>
 /// <param name="minRevision">The minimum revision of the stream to be read.</param>
 /// <param name="maxRevision">The maximum revision of the stream to be read.</param>
 /// <returns>A series of committed events represented as a stream.</returns>
 /// <exception cref="StorageException" />
 /// <exception cref="StorageUnavailableException" />
 /// <exception cref="StreamNotFoundException" />
 public static Task <IEventStream> OpenStreamAsync(this IStoreEvents storeEvents, string bucketId, Guid streamId, CancellationToken cancellationToken, int minRevision = int.MinValue, int maxRevision = int.MaxValue)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.OpenStreamAsync(bucketId, streamId.ToString(), minRevision, maxRevision, cancellationToken));
 }
Exemplo n.º 49
0
 /// <summary>
 ///     Reads the stream indicated from the minimum revision specified up to the maximum revision specified or creates
 ///     an empty stream if no commits are found and a minimum revision of zero is provided.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream from which the events will be read.</param>
 /// <param name="minRevision">The minimum revision of the stream to be read.</param>
 /// <param name="maxRevision">The maximum revision of the stream to be read.</param>
 /// <returns>A series of committed events represented as a stream.</returns>
 /// <exception cref="StorageException" />
 /// <exception cref="StorageUnavailableException" />
 /// <exception cref="StreamNotFoundException" />
 public static IEventStream OpenStream(this IStoreEvents storeEvents, Guid streamId, int minRevision = int.MinValue, int maxRevision = int.MaxValue)
 {
     return(OpenStream(storeEvents, Bucket.Default, streamId, minRevision, maxRevision));
 }
Exemplo n.º 50
0
 protected override void Context()
 {
     _storeEvents   = Wireup.Init().UsingInMemoryPersistence().Build();
     _pollingClient = new PollingClientRx(_storeEvents.Advanced, PollingInterval);
 }
Exemplo n.º 51
0
 /// <summary>
 ///     Creates a new stream.
 /// </summary>
 /// <param name="storeEvents">The store events instance.</param>
 /// <param name="streamId">The value which uniquely identifies the stream to be created.</param>
 /// <returns>An empty stream.</returns>
 public static IEventStream CreateStream(this IStoreEvents storeEvents, string streamId)
 {
     EnsureStoreEventsNotNull(storeEvents);
     return(storeEvents.CreateStream(Bucket.Default, streamId));
 }
 public IgnoreConflictResolver(IStoreEvents store, IOobWriter oobStore)
 {
     _store    = store;
     _oobStore = oobStore;
 }
 public EventStorageRepository(IStoreEvents storage)
 {
     this.storage = storage;
 }
Exemplo n.º 54
0
 protected override void Context()
 {
     this._storeEvents = Wireup.Init().UsingInMemoryPersistence().Build();
     this._repository  = new EventStoreRepository(this._storeEvents, new AggregateFactory(), new ConflictDetector());
 }
Exemplo n.º 55
0
 public EventStoreRepository(IStoreEvents eventStore, IConstructAggregates factory, IDetectConflicts conflictDetector)
 {
     _eventStore       = eventStore;
     _factory          = factory;
     _conflictDetector = conflictDetector;
 }
 public ResolveWeaklyConflictResolver(IStoreEvents eventstore, IDelayedChannel delay)
 {
     _eventstore = eventstore;
     _delay      = delay;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Repository{TAggregateRoot}"/> class.
 /// </summary>
 /// <param name="rootFactory">The aggregate root entity factory.</param>
 /// <param name="unitOfWork">The unit of work to interact with.</param>
 /// <param name="eventStore">The event store to use.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when the <paramref name="rootFactory"/> or <paramref name="unitOfWork"/> or <paramref name="eventStore"/> is null.</exception>
 public Repository(Func <TAggregateRoot> rootFactory, UnitOfWork unitOfWork, IStoreEvents eventStore)
 {
     _rootFactory = rootFactory ?? throw new ArgumentNullException(nameof(rootFactory));
     _unitOfWork  = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _eventStore  = eventStore ?? throw new ArgumentNullException(nameof(eventStore));
 }
Exemplo n.º 58
0
 public WebHistoryEndpoint(IStoreEvents es)
 {
     this.es = es;
 }
Exemplo n.º 59
0
 public void Stop()
 {
     _store.Dispose();
     _store = null;
 }
 public NEventStoreRepository(IStoreEvents eventStore, IServiceProvider serviceProvider, ILogger logger = null) : base(serviceProvider)
 {
     _eventStore = eventStore;
     _logger     = logger ?? NullLogger.Instance;
 }