using System.Net.Http; using System.Text.Encodings.Web; using AntDesign; using AntDesign.JsInterop; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; namespace Microsoft.Extensions.DependencyInjection { public static class ServiceCollectionExtensions { public static IServiceCollection AddAntDesign(this IServiceCollection services) { services.TryAddSingleton(); services.TryAddScoped(); services.TryAddScoped(sp => new HtmlRenderService(new HtmlRenderer(sp, sp.GetRequiredService(), s => HtmlEncoder.Default.Encode(s))) ); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); return services; } } }