Beispiel #1
0
    /// <summary>
    /// Gets the configuration section of an <see cref="IConfiguration"/> for a Dolittle configuration.
    /// </summary>
    /// <param name="definition">The <see cref="ConfigurationObjectDefinition{TOptions}"/> of the Dolittle configuration to get the configuration section for.</param>
    /// <returns>The configuration section string.</returns>
    protected virtual string GetConfigurationSection(ConfigurationObjectDefinition <TOptions> definition)
    {
        if (definition.IsPerTenant)
        {
            throw new CannotCreateTenantSpecificConfigurationFromRootContainer();
        }

        return(GetConfigurationSectionWithPrefix(definition.Section));
    }
Beispiel #2
0
 /// <inheritdoc />
 protected override string GetConfigurationSection(ConfigurationObjectDefinition <TOptions> definition)
 => definition.IsPerTenant
         ? GetConfigurationSectionWithPrefix($"tenants:{_tenant}:{definition.Section}")
         : base.GetConfigurationSection(definition);