mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-04 13:08:23 +08:00
042694b96f
* feat: add component message * fix: then interface and demo bugs Co-authored-by: James Yeung <shunjiey@hotmail.com>
29 lines
977 B
C#
29 lines
977 B
C#
using System.Net.Http;
|
|
using System.Text.Encodings.Web;
|
|
using AntBlazor;
|
|
using AntBlazor.JsInterop;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddAntBlazor(this IServiceCollection services)
|
|
{
|
|
services.TryAddSingleton<HttpClient>();
|
|
services.TryAddScoped<DomEventService>();
|
|
services.TryAddScoped(sp => new HtmlRenderService(new HtmlRenderer(sp, sp.GetRequiredService<ILoggerFactory>(),
|
|
s => HtmlEncoder.Default.Encode(s)))
|
|
);
|
|
|
|
services.TryAddScoped<IconService>();
|
|
services.TryAddScoped<InteropService>();
|
|
services.TryAddScoped<NotificationService>();
|
|
services.TryAddScoped<MessageService>();
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|