public JsonStringLocalizerFactory(
     IOptions <JsonLocalizationOptions> localizationOptions,
     JsonStringLocalizerInMemoryCache jsonStringLocalizerInMemoryCache,
     ILoggerFactory loggerFactory)
 {
     if (localizationOptions == null)
     {
         throw new ArgumentNullException(nameof(localizationOptions));
     }
     _loggerFactory                    = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     _resourcesRelativePath            = localizationOptions.Value.ResourcesPath;
     _resourcesType                    = localizationOptions.Value.ResourcesType;
     _resourcesLoadMode                = localizationOptions.Value.ResourcesLoadMode;
     _resourcesCacheMode               = localizationOptions.Value.ResourcesCacheMode;
     _jsonStringLocalizerInMemoryCache = jsonStringLocalizerInMemoryCache;
 }
Ejemplo n.º 2
0
 public JsonStringLocalizer(
     string resourcesPath,
     string resourceName,
     ResourcesType resourcesType,
     ResourcesLoadMode resourcesLoadMode,
     ResourcesCacheMode resourcesCacheMode,
     JsonStringLocalizerInMemoryCache jsonStringLocalizerInMemoryCache,
     Assembly executingAssembly,
     ILogger logger)
 {
     _resourcesPath      = resourcesPath ?? throw new ArgumentNullException(nameof(resourcesPath));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _resourceName       = resourceName;
     _resourcesType      = resourcesType;
     _resourcesLoadMode  = resourcesLoadMode;
     _resourcesCacheMode = resourcesCacheMode;
     _jsonStringLocalizerInMemoryCache = jsonStringLocalizerInMemoryCache;
     _executingAssembly = executingAssembly;
 }