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