/// <inheritdoc/> public void RequirePersistence <TFeature>(IServiceCollection services, string persistenceProviderImplementation = null) where TFeature : IFullNodeFeature { if (persistenceProviderImplementation == null) { persistenceProviderImplementation = this.nodeSettings.DbType ?? this.GetDefaultProvider(); } IPersistenceProvider provider = null; if (this.persistenceProviders.TryGetValue(persistenceProviderImplementation.ToLowerInvariant(), out List <IPersistenceProvider> providersList)) { provider = providersList.FirstOrDefault(provider => provider.FeatureType == typeof(TFeature)); if (provider == null) { throw new NodeBuilderException($"Required persistence provider {persistenceProviderImplementation} doesn't implement persistence for {typeof(TFeature).Name}."); } provider.AddRequiredServices(services); } else { throw new NodeBuilderException($"Required persistence provider implementation {persistenceProviderImplementation} Not found."); } }