Example #1
0
        /// <summary>
        /// Use Cosmos I18N
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="antConfigure"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static IApplicationBuilder UseInternationalizationService(this IApplicationBuilder builder, Action <AntConfig> antConfigure)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var antConfig = new AntConfig();

            antConfigure?.Invoke(antConfig);

            builder.UseInternationalizationService();

            AntHooks.Insert(antConfig.GetAllAnts());

            builder.UseMiddleware <ScopedLanguageTagMiddleware>();

            return(builder);
        }