Admin.net框架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

5 days ago
namespace Admin.NET.Core;
/// <summary>
/// 数据库配置选项
/// </summary>
public sealed class DbConnectionOptions : IConfigurableOptions<DbConnectionOptions>
{
/// <summary>
/// 数据库集合
/// </summary>
public List<DbConnectionConfig> ConnectionConfigs { get; set; }
public void PostConfigure(DbConnectionOptions options, IConfiguration configuration)
{
foreach (var dbConfig in options.ConnectionConfigs)
{
if (string.IsNullOrWhiteSpace(dbConfig.ConfigId))
dbConfig.ConfigId = SqlSugarConst.ConfigId;
}
}
}
public sealed class DbConnectionConfig : ConnectionConfig
{
/// <summary>
/// 启用库表初始化
/// </summary>
public bool EnableInitDb { get; set; }
/// <summary>
/// 启用种子初始化
/// </summary>
public bool EnableInitSeed { get; set; }
/// <summary>
/// 启用库表差异日志
/// </summary>
public bool EnableDiffLog { get; set; }
/// <summary>
/// 启用驼峰转下划线
/// </summary>
public bool EnableUnderLine { get; set; }
}