コード例 #1
0
        public void SetUp()
        {
            MongoFlatMapper.EnableFlatMapping(true);
            MongoDbTestConnectionProvider.ReadModelDb.Drop();

            var mngr = new IdentityManager(new CounterService(MongoDbTestConnectionProvider.ReadModelDb));

            mngr.RegisterIdentitiesFromAssembly(typeof(DocumentDescriptorId).Assembly);

            MongoFlatIdSerializerHelper.Initialize(mngr);

            EventStoreIdentityCustomBsonTypeMapper.Register <DocumentDescriptorId>();
            EventStoreIdentityCustomBsonTypeMapper.Register <DocumentId>();
            StringValueCustomBsonTypeMapper.Register <BlobId>();
            StringValueCustomBsonTypeMapper.Register <DocumentHandle>();
            StringValueCustomBsonTypeMapper.Register <FileHash>();

            _writer = new DocumentWriter(MongoDbTestConnectionProvider.ReadModelDb);
            var _documentDescriptorCollection = new MongoReaderForProjections <DocumentDescriptorReadModel, DocumentDescriptorId>
                                                (
                new MongoStorageFactory(MongoDbTestConnectionProvider.ReadModelDb,
                                        new RebuildContext(true)));
            var _documentDeletedCollection = new CollectionWrapper <DocumentDeletedReadModel, String>
                                             (
                new MongoStorageFactory(MongoDbTestConnectionProvider.ReadModelDb,
                                        new RebuildContext(true)), null);

            _sut = new DocumentProjection(_writer, _documentDescriptorCollection, _documentDeletedCollection);
        }
コード例 #2
0
        public void SetUp()
        {
            MongoFlatMapper.EnableFlatMapping(true);
            MongoDbTestConnectionProvider.ReadModelDb.Drop();

            var mngr = new IdentityManager(new CounterService(MongoDbTestConnectionProvider.ReadModelDb));
            mngr.RegisterIdentitiesFromAssembly(typeof(DocumentDescriptorId).Assembly);

            MongoFlatIdSerializerHelper.Initialize(mngr);

            EventStoreIdentityCustomBsonTypeMapper.Register<DocumentDescriptorId>();
            EventStoreIdentityCustomBsonTypeMapper.Register<DocumentId>();
            StringValueCustomBsonTypeMapper.Register<BlobId>();
            StringValueCustomBsonTypeMapper.Register<DocumentHandle>();
            StringValueCustomBsonTypeMapper.Register<FileHash>();

            _writer = new DocumentWriter(MongoDbTestConnectionProvider.ReadModelDb);
            var _documentDescriptorCollection = new MongoReaderForProjections<DocumentDescriptorReadModel, DocumentDescriptorId>
                (
                new MongoStorageFactory(MongoDbTestConnectionProvider.ReadModelDb, 
                    new RebuildContext(true)));
            var _documentDeletedCollection = new CollectionWrapper<DocumentDeletedReadModel, String>
               (
               new MongoStorageFactory(MongoDbTestConnectionProvider.ReadModelDb,
                   new RebuildContext(true)), null);
            _sut = new DocumentProjection(_writer, _documentDescriptorCollection, _documentDeletedCollection);
        }