升级包
This commit is contained in:
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using ZR.Model;
|
||||
|
||||
namespace ZR.Repository
|
||||
@@ -18,22 +19,17 @@ namespace ZR.Repository
|
||||
public BaseRepository(ISqlSugarClient context = null) : base(context)
|
||||
{
|
||||
//通过特性拿到ConfigId
|
||||
//var configId = typeof(T).GetCustomAttribute<TenantAttribute>()?.configId;
|
||||
//if (configId != null)
|
||||
//{
|
||||
// itenant = DbScoped.SugarScope;//设置租户接口
|
||||
// Context = DbScoped.SugarScope.GetConnection(configId);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Context = context ?? DbScoped.SugarScope.GetConnection(1);//根据类传入的ConfigId自动选择
|
||||
//}
|
||||
Context = DbScoped.SugarScope.GetConnectionWithAttr<T>();
|
||||
itenant = DbScoped.SugarScope;//设置租户接口
|
||||
if (Context == null)
|
||||
var configId = typeof(T).GetCustomAttribute<TenantAttribute>()?.configId;
|
||||
if (configId != null)
|
||||
{
|
||||
Context = DbScoped.SugarScope.GetConnection(1);//根据类传入的ConfigId自动选择
|
||||
Context = DbScoped.SugarScope.GetConnectionScope(configId);//根据类传入的ConfigId自动选择
|
||||
}
|
||||
else
|
||||
{
|
||||
Context = context ?? DbScoped.SugarScope.GetConnectionScope(0);//没有默认db0
|
||||
}
|
||||
//Context = DbScoped.SugarScope.GetConnectionScopeWithAttr<T>();
|
||||
itenant = DbScoped.SugarScope;//设置租户接口
|
||||
}
|
||||
|
||||
#region add
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MySql.Data" Version="8.0.25" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.29" />
|
||||
<PackageReference Include="NETCore.Encrypt" Version="2.1.0" />
|
||||
<PackageReference Include="SqlSugar.IOC" Version="1.8.0" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.7.8" />
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.0.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user