Closed liyuan0420 closed 5 years ago
SmartSql-V4 已支持注入外部配置,见以下demo
services
.AddSmartSql((builder) =>
{
builder.UseProperties(Configuration);
})
.AddRepositoryFromAssembly(o =>
{
o.AssemblyString = "SmartSql.Sample.AspNetCore";
o.Filter = (type) =>
{
return type.Namespace == "SmartSql.Sample.AspNetCore.DyRepositories";
};
});
https://github.com/Smart-Kit/SmartSql/blob/master/sample/SmartSql.Sample.AspNetCore/Startup.cs#L26
1.提取到Config统一配置Connection; 2.可加入环境变量配置