Beispiel #1
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();
        }
Beispiel #2
0
 /// <summary>
 /// Регистрировать модули.
 /// </summary>
 /// <param name="collection">Коллекция.</param>
 public static void RegisterModules(IModuleCollection collection)
 {
     CommonSerializationRegistration.RegisterModules(collection);
     LinkModelsRegistration.RegisterModules(collection);
     PostModelsRegistration.RegisterModules(collection);
 }