コード例 #1
0
        /// <summary>
        /// Maps a ConfigSection to a XmlTranslationsConfig object
        /// </summary>
        public static XmlTranslationsConfig GetXmlTranslationsConfig(this IConfigurationSection config)
        {
            var conf = new XmlTranslationsConfig();

            config.Bind(conf);
            return(conf);
        }
コード例 #2
0
 /// <summary>
 /// Initialize Xml Translations
 ///
 /// Using this service requires to register
 ///   IActionContextAccessor service
 ///   ISupportedLangsService service
 ///   IMemoryCache service
 /// </summary>
 public static void InitXmlTranslations(this IServiceCollection services, XmlTranslationsConfig config, ILogger logger = null)
 => services.InitXmlTranslations(new[] { config }, logger);