コード例 #1
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider)
        {
            Guard.NotNull(appProvider, nameof(appProvider));

            collectionAll =
                new MongoContentCollection("States_Contents_All3", database, appProvider);

            collectionPublished =
                new MongoContentCollection("States_Contents_Published3", database, appProvider);

            this.appProvider = appProvider;
        }
コード例 #2
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider)
        {
            collectionAll =
                new MongoContentCollection("States_Contents_All3", database, appProvider,
                                           ReadPreference.Primary);

            collectionPublished =
                new MongoContentCollection("States_Contents_Published3", database, appProvider,
                                           ReadPreference.Secondary);

            this.appProvider = appProvider;
        }
コード例 #3
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, IJsonSerializer serializer, ITextIndexer indexer, TypeNameRegistry typeNameRegistry)
        {
            Guard.NotNull(appProvider, nameof(appProvider));
            Guard.NotNull(serializer, nameof(serializer));
            Guard.NotNull(indexer, nameof(indexer));
            Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry));

            this.appProvider = appProvider;
            this.indexer     = indexer;
            this.serializer  = serializer;

            typeAssetDeleted   = typeNameRegistry.GetName <AssetDeleted>();
            typeContentDeleted = typeNameRegistry.GetName <ContentDeleted>();

            contents = new MongoContentCollection(database, serializer, appProvider);
        }
コード例 #4
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, IJsonSerializer serializer)
        {
            Guard.NotNull(appProvider, nameof(appProvider));
            Guard.NotNull(serializer, nameof(serializer));

            this.appProvider = appProvider;

            converter = new DataConverter(serializer);

            collectionAll =
                new MongoContentCollection(
                    "States_Contents_All2", database, appProvider, indexer, converter);

            collectionPublished =
                new MongoContentCollection(
                    "States_Contents_Published2", database, appProvider, indexer, converter);
        }