using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudBuilder.Core.Application.Options
{
///
/// CloudBuilder框架配置选项信息
///
public class CloudBuilderOptions
{
///
/// 初始化一个类型的新实例
///
public CloudBuilderOptions()
{
DbContexts = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase);
}
///
/// 获取 数据上下文配置信息
///
public IDictionary DbContexts { get; }
/////
///// 获取 第三方OAuth2登录配置信息
/////
//public IDictionary OAuth2S { get; }
///
/// 获取或设置 邮件发送选项
///
public MailSenderOptions MailSender { get; set; }
///
/// 全局授权
///
public bool EnableGlobalAuthorize { get; set; }
///
/// 获取或设置 JWT身份认证选项
///
public JwtOptions Jwt { get; set; }
///
/// 获取或设置 Redis选项
///
public RedisOptions Redis { get; set; }
/////
///// 获取或设置 Swagger选项
/////
//public SwaggerOptions Swagger { get; set; }
/////
///// 获取或设置 Http传输加密选项
/////
//public HttpEncryptOptions HttpEncrypt { get; set; }
///
/// 获取指定上下文类和指定数据库类型的上下文配置信息
///
public CloudBuilderDbContextOptions GetDbContextOptions(string dbContextType)
{
return DbContexts.Values.SingleOrDefault(m => m.DbContextTypeName == dbContextType);
}
}
}