Optimization tip

This commit is contained in:
sunkaixuna
2021-12-23 17:46:18 +08:00
parent ce46b9a081
commit 3fdd979156

View File

@@ -1922,8 +1922,15 @@ namespace SqlSugar
return reslut; return reslut;
} }
protected ISugarQueryable<T> _As(string tableName, string entityName) protected ISugarQueryable<T> _As(string tableName, string entityName)
{
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Any(it => it.Key == entityName))
{
Check.Exception(true, ErrorMessage.GetThrowMessage($"use As<{tableName}>(\"{tableName}\")", $"请把 As(\"{tableName}\"), 改成 As<{tableName}实体>(\"{tableName}\")"));
}
else
{ {
this.QueryBuilder.AsTables.Add(entityName, tableName); this.QueryBuilder.AsTables.Add(entityName, tableName);
}
return this; return this;
} }
protected void _Filter(string FilterName, bool isDisabledGobalFilter) protected void _Filter(string FilterName, bool isDisabledGobalFilter)