mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
Optimization error prompt
This commit is contained in:
@@ -17,7 +17,12 @@ namespace SqlSugar
|
||||
|
||||
public ITenant AsTenant()
|
||||
{
|
||||
return this.Context as ITenant;
|
||||
var result= this.Context as ITenant;
|
||||
if (result == null)
|
||||
{
|
||||
Check.ExceptionEasy("Context= is a child db. AsTenant() method is not available. You can store the master db in variables of the warehouse class, and then use the master db to implement tenants and transactions and so on", "仓储.Context=的是子db无法使用AsTenant()方法,你可以将主db存在仓储类里面的变量中,然后用主db变量实现租户和事务等作");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public ISqlSugarClient AsSugarClient()
|
||||
{
|
||||
|
Reference in New Issue
Block a user