增加多租户的配置

This commit is contained in:
不做码农
2021-10-29 13:23:22 +08:00
parent 60c25735b0
commit 39fc3918fa
6 changed files with 28 additions and 34 deletions

View File

@@ -2,6 +2,8 @@ using System;
using Infrastructure.Attribute;
using ZR.Repository.System;
using ZR.Model.Models;
using SqlSugar;
using SqlSugar.IOC;
namespace ZR.Repository
{
@@ -14,12 +16,17 @@ namespace ZR.Repository
[AppService(ServiceLifetime = LifeTime.Transient)]
public class GendemoRepository : BaseRepository<Gendemo>
{
public GendemoRepository() : base(configId: "1")
private readonly ISqlSugarClient db;
public GendemoRepository()
{
db = DbScoped.SugarScope.GetConnection(1);
}
#region
public void Test()
{
var date = db.GetDate();
}
#endregion
}
}