Пример #1
0
        public async Task Initilize(int parallelTasks)
        {
            _collection = new ModuleCollection();

            ModelsRegistration.RegisterModules(_collection);
            PostModelsRegistration.RegisterModules(_collection);
            _collection.RegisterModule <EsentInstanceProvider, IEsentInstanceProvider>(new EsentInstanceProvider(true));
            _collection.RegisterModule <PostModelStore, IBoardPostStore>(new PostModelStore("makaba", parallelTasks));
            _collection.RegisterModule <MakabaBoardReferenceDtoParsers, INetworkDtoParsers>();
            _collection.RegisterModule <MakabaBoardReferenceDtoParsers, INetworkDtoParsers>();
            _collection.RegisterModule <YoutubeIdService, IYoutubeIdService>();
            _collection.RegisterModule <MakabaLinkParser, IEngineLinkParser>();
            _collection.RegisterModule <AgilityHtmlDocumentFactory, IHtmlDocumentFactory>();
            _collection.RegisterModule <MakabaHtmlParser, IHtmlParser>();
            _collection.RegisterModule <MakabaPostDtoParsers, INetworkDtoParsers>();
            MakabaModelsRegistration.RegisterModules(_collection);

            TableVersionStatusForTests.ClearInstance();
            await _collection.Seal();

            _provider = _collection.GetModuleProvider();
            var module = _provider.QueryModule(typeof(IBoardPostStore), "makaba") ?? throw new ModuleNotFoundException();

            _store = module.QueryView <IBoardPostStore>() ?? throw new ModuleNotFoundException();
        }
Пример #2
0
        public async Task Initialize()
        {
            _collection = new ModuleCollection();

            LinkModelsRegistration.RegisterModules(_collection);
            CommonSerializationRegistration.RegisterModules(_collection);
            _collection.RegisterModule <EsentInstanceProvider, IEsentInstanceProvider>(new EsentInstanceProvider(true));
            _collection.RegisterModule <BlobsModelStore, IBlobsModelStore>();
            _collection.RegisterModule <MakabaBoardReferenceDtoParsers, INetworkDtoParsers>();

            TableVersionStatusForTests.ClearInstance();
            await _collection.Seal();

            _provider = _collection.GetModuleProvider();
            var module = _provider.QueryModule <object>(typeof(IBlobsModelStore), null) ?? throw new ModuleNotFoundException();

            _store = module.QueryView <IBlobsModelStore>() ?? throw new ModuleNotFoundException();
        }