tuitio/IdentityServer.Application/DependencyInjectionExtensio...

26 lines
903 B
C#
Raw Normal View History

2020-12-20 03:06:43 +02:00
using IdentityServer.Application.Services;
2021-11-13 17:17:13 +02:00
using IdentityServer.Application.Services.Abstractions;
2020-12-20 03:06:43 +02:00
using IdentityServer.Application.Stores;
2021-11-13 17:17:13 +02:00
using IdentityServer.Domain.Abstractions;
2020-12-20 03:06:43 +02:00
using Microsoft.Extensions.DependencyInjection;
namespace IdentityServer.Application
{
public static class DependencyInjectionExtensions
{
public static void AddApplicationServices(this IServiceCollection services)
{
services.AddStores();
2021-11-13 17:17:13 +02:00
services.AddSingleton<IConfigProvider, ConfigProvider>();
services.AddSingleton<ITokenService, TokenService>();
2020-12-20 03:06:43 +02:00
services.AddScoped<IUserService, UserService>();
2021-11-13 20:58:17 +02:00
services.AddSingleton<IBehaviorService, BehaviorService>();
2020-12-20 03:06:43 +02:00
}
private static void AddStores(this IServiceCollection services)
{
2021-11-13 17:17:13 +02:00
services.AddSingleton<ITokenStore, TokenStore>();
2020-12-20 03:06:43 +02:00
}
}
}