Optimization error prompt

This commit is contained in:
sunkaixuan
2023-06-04 22:19:21 +08:00
parent 59a6f0818b
commit e53b6ea037

View File

@@ -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()
{