Beispiel #1
0
 public EcbExchangeRateProvider(EcbExchangeRateSettings ecbExchangeRateSettings,
                                IHttpClientFactory httpClientFactory,
                                ILocalizationService localizationService,
                                ILogger logger,
                                ISettingService settingService)
 {
     _ecbExchangeRateSettings = ecbExchangeRateSettings;
     _httpClientFactory       = httpClientFactory;
     _localizationService     = localizationService;
     _logger         = logger;
     _settingService = settingService;
 }
Beispiel #2
0
        /// <summary>
        /// Install the plugin
        /// </summary>
        /// <returns>A task that represents the asynchronous operation</returns>
        public override async Task InstallAsync()
        {
            //settings
            var defaultSettings = new EcbExchangeRateSettings
            {
                EcbLink = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"
            };
            await _settingService.SaveSettingAsync(defaultSettings);

            //locales
            await _localizationService.AddOrUpdateLocaleResourceAsync("Plugins.ExchangeRate.EcbExchange.Error", "You can use ECB (European central bank) exchange rate provider only when the primary exchange rate currency is supported by ECB");

            await base.InstallAsync();
        }