Update childDb.AsTenant()

This commit is contained in:
sunkaixuan
2023-06-30 13:13:32 +08:00
parent 33c577e59d
commit 79a0de3b80

View File

@@ -1664,8 +1664,15 @@ namespace SqlSugar
#region AsTenant #region AsTenant
public ITenant AsTenant() public ITenant AsTenant()
{ {
Check.Exception(true,ErrorMessage.GetThrowMessage("Child objects do not support tenant methods, var childDb= Db.GetConnection(confid) ,Db is master ", "Db子对象不支持租户方法请使用主对象,例如var childDb= Db.GetConnection(confid) Db是主对象childDb是子对象 ")); if (this.Root != null)
return null; {
return this.Root;
}
else
{
Check.Exception(true, ErrorMessage.GetThrowMessage("Child objects do not support tenant methods, var childDb= Db.GetConnection(confid) ,Db is master ", "Db子对象不支持租户方法请使用主对象,例如var childDb= Db.GetConnection(confid) Db是主对象childDb是子对象 "));
return null;
}
} }
#endregion #endregion