Synchronization code

This commit is contained in:
sunkaixuan 2023-06-04 22:29:35 +08:00
parent 85961f1e27
commit ddf89601c4

View File

@ -17,7 +17,16 @@ namespace SqlSugar
public ITenant AsTenant()
{
return this.Context as ITenant;
var result= this.Context as ITenant;
if (result == null&& this.Context is SqlSugarProvider)
{
result = (this.Context as SqlSugarProvider).Root as ITenant;
}
else if (result == null && this.Context is SqlSugarScopeProvider)
{
result = (this.Context as SqlSugarScopeProvider).conn.Root as ITenant;
}
return result;
}
public ISqlSugarClient AsSugarClient()
{