Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public async Task Initialize()
        {
            _collection = new ModuleCollection();
            _collection.RegisterModule <ObjectSerializationService, IObjectSerializationService>();
            PostModelsRegistration.RegisterModules(_collection);
            LinkModelsRegistration.RegisterModules(_collection);
            _collection.RegisterModule <FakeExternalPostMediaSerializer, IObjectSerializer>();
            _collection.RegisterModule <FakePostAttributeSerializer, IObjectSerializer>();
            _collection.RegisterModule <FakePostNodeSerializer, IObjectSerializer>();
            await _collection.Seal();

            _modules = _collection.GetModuleProvider();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Регистрировать модули.
 /// </summary>
 /// <param name="collection">Коллекция.</param>
 public static void RegisterModules(IModuleCollection collection)
 {
     CommonSerializationRegistration.RegisterModules(collection);
     LinkModelsRegistration.RegisterModules(collection);
     PostModelsRegistration.RegisterModules(collection);
 }