using System;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace FAuth.Extensions.Decryptor
{
///
/// 扩展IServiceCollection注册IUserTicketDryptor
///
public static class ServiceCollentionExtent
{
///
/// 通过显示配置注册IUserTicketDryptor
///
/// 服务集合
/// 配置选项的方法
/// 服务集合
public static IServiceCollection AddUserTicketDryptor(this IServiceCollection service,Action action) {
service.Configure(action);
service.AddSingleton();
return service;
}
///
/// 通过提供配置节点信息注册IUserTicketDryptor
///
/// 服务集合
/// 配置文件节点
/// 服务集合
public static IServiceCollection AddUserTicketDryptor(this IServiceCollection services,IConfigurationSection section) {
services.Configure(section);
services.AddSingleton();
return services;
}
}
}