Ejemplo n.º 1
0
 public CacheProvider(IMemoryCache cache,
                      IOptions <LocalizerOptions> localizationOptions)
 {
     _settings = localizationOptions == null
         ? throw new ArgumentNullException(nameof(localizationOptions))
         : localizationOptions.Value;
     _innerCache = cache;
 }
 public LocalizerFactory(IOptions <LocalizerOptions> localizerOptions,
                         LocalizationProvider <T> manager)
 {
     _provider = manager ?? throw new ArgumentException(nameof(manager));
     _settings = localizerOptions == null
         ? throw new ArgumentNullException(nameof(localizerOptions))
         : localizerOptions.Value;
 }
 public LocalizationProvider(IServiceProvider serviceProvider,
                             ICacheProvider cacheProvider,
                             IOptions <LocalizerOptions> localizationOptions,
                             IOptions <RequestLocalizationOptions> requestLocalizationOptions)
 {
     _serviceProvider = serviceProvider;
     _cacheProvider   = cacheProvider;
     _settings        = localizationOptions == null
         ? throw new ArgumentNullException(nameof(localizationOptions))
         : localizationOptions.Value;
     _requestLocalizationSettings = requestLocalizationOptions == null
         ? throw new ArgumentNullException(nameof(requestLocalizationOptions))
         : requestLocalizationOptions.Value;
 }