system.invalidoperationException: сбор был изменен; Операция перечисления не может выполняться.
at system.collections.generic.list
Код: Выделить всё
1.Enumerator.MoveNext() at Microsoft.Extensions.Options.OptionsMonitor< /code> 1.dispose ()
at microsoft.extensions.dependencyInction.serviceLookup.serviceProviderEnginescope.disposeAsync () < /p>
public class ConfigurationParametersProvider : IConfigurationParametersProvider where T : GlobalAppConfiguration
{
private readonly T _jsonAppConfiguration;
private readonly T _databaseAppConfiguration;
///
/// Initializes a new instance of the class.
/// Determines the data source (JSON or database) based on the availability of the database configuration.
///
///
The options monitor of application configuration options.
/// The localization service for Name and Description localization purposes based on class.
/// The logger
public ConfigurationParametersProvider(IOptionsMonitor appConfigurationOptionsMonitor, ILogger logger)
{
_jsonAppConfiguration = appConfigurationOptionsMonitor.Get(GlobalAppConfiguration.JsonSection);
_databaseAppConfiguration = appConfigurationOptionsMonitor.Get(GlobalAppConfiguration.DatabaseSection);
}
///
///
///
public T Value => _databaseAppConfiguration;
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... s-modified
Мобильная версия