Ejemplo n.º 1
0
 public EventMapper(IEventSerializer serializer, IEventHash hash)
 {
     Precondition.For(hash, nameof(hash)).NotNull();
     Precondition.For(serializer, nameof(serializer)).NotNull();
     this.serializer = serializer;
     this.eventHash  = hash;
 }
Ejemplo n.º 2
0
 public MongoCommitRepository(IMongoDatabase db, IEventHash hash, IEventSerializer eventSerializer,
                              ILogger <MongoCommitRepository> logger,
                              bool useTransactions, bool deactivateTimeoutOnRead) : base(db,
                                                                                         "es_Commits")
 {
     this.logger             = logger;
     UseTransactions         = useTransactions;
     DeactivateTimeoutOnRead = deactivateTimeoutOnRead;
     Mapper     = new EventMapper(eventSerializer, hash);
     identifier = new MongoGlobalIdentifier(db);
     PrepareCollection(Collection).Wait();
 }
Ejemplo n.º 3
0
        public MongoEventSubscriber(IMongoDatabase db, ILoggerFactory loggerFactory, IEventHash hash,
                                    IEventSerializer eventSerializer,
                                    bool useTransactions, bool deactivateTimeoutOnRead)
        {
            Precondition.For(db, nameof(db)).NotNull();
            Precondition.For(loggerFactory, nameof(loggerFactory)).NotNull();

            mapper = new EventMapper(eventSerializer, hash);
            logger = loggerFactory.CreateLogger <MongoEventSubscriber>();
            repo   = new MongoCommitRepository(db, hash, eventSerializer,
                                               loggerFactory.CreateLogger <MongoCommitRepository>(),
                                               useTransactions, deactivateTimeoutOnRead);
        }