mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 01:46:18 +08:00
Synchronization code
This commit is contained in:
parent
85961f1e27
commit
ddf89601c4
@ -17,7 +17,16 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public ITenant AsTenant()
|
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()
|
public ISqlSugarClient AsSugarClient()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user