feat: 完成多db功能搭建

This commit is contained in:
chenchun
2024-11-19 11:53:57 +08:00
parent 9acb157fae
commit 5d2d269f11
10 changed files with 278 additions and 168 deletions

View File

@@ -33,7 +33,7 @@ namespace Yi.Abp.SqlsugarCore
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddYiDbContext<YiDbContextFactory>();
context.Services.AddYiDbContext<YiDbContext>();
//默认不开放可根据项目需要是否Db直接对外开放
//context.Services.AddTransient(x => x.GetRequiredService<ISqlSugarDbContext>().SqlSugarClient);
}

View File

@@ -6,10 +6,7 @@ using Yi.Framework.SqlSugarCore;
namespace Yi.Abp.SqlSugarCore
{
public class YiDbContextFactory : YiRbacDbContextFactory
public class YiDbContext : SqlSugarDbContext
{
public YiDbContextFactory(IAbpLazyServiceProvider lazyServiceProvider) : base(lazyServiceProvider)
{
}
}
}