ant-design-blazor/site/AntDesign.Docs/ServiceCollectionExtensions.cs
2021-02-06 20:15:46 +08:00

24 lines
792 B
C#

using System.Reflection;
using AntDesign.Docs.Highlight;
using AntDesign.Docs.Localization;
using AntDesign.Docs.Routing;
using AntDesign.Docs.Services;
namespace Microsoft.Extensions.DependencyInjection
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddAntDesignDocs(this IServiceCollection services)
{
services.AddAntDesign();
services.AddSingleton<RouteManager>();
services.AddScoped<DemoService>();
services.AddScoped<IconListService>();
services.AddSingleton<ILanguageService>(new InAssemblyLanguageService(Assembly.GetExecutingAssembly()));
services.AddScoped<IPrismHighlighter, PrismHighlighter>();
return services;
}
}
}