using HTEXLib.Translator; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using System; using System.Collections.Generic; using System.Text; namespace HTEXLib.Translator { public static class HtexExtensions { public static IServiceCollection AddHtexTranslator(this IServiceCollection services,string configPath) { if (services == null) throw new ArgumentNullException(nameof(services)); services.TryAddScoped(); services.TryAddScoped(); //services.TryAddScoped(); // services.TryAddSingleton(new HTML2ITEMV2Translator(configPath)); services.TryAddSingleton(new HTML2ITEMV3Translator(configPath)); return services; } } }