mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 20:43:46 +08:00
Synchronization code
This commit is contained in:
@@ -17,32 +17,37 @@ namespace SqlSugar
|
|||||||
return GetEntityInfo(typeof(T));
|
return GetEntityInfo(typeof(T));
|
||||||
}
|
}
|
||||||
public EntityInfo GetEntityInfoWithAttr(Type type)
|
public EntityInfo GetEntityInfoWithAttr(Type type)
|
||||||
|
{
|
||||||
|
return GetEntityInfo(type);
|
||||||
|
}
|
||||||
|
public EntityInfo GetEntityInfo(Type type)
|
||||||
{
|
{
|
||||||
var attr = type?.GetCustomAttribute<TenantAttribute>();
|
var attr = type?.GetCustomAttribute<TenantAttribute>();
|
||||||
if (attr == null)
|
if (attr == null)
|
||||||
{
|
{
|
||||||
return GetEntityInfo(type);
|
return _GetEntityInfo(type);
|
||||||
}
|
}
|
||||||
else if (attr.configId.ObjToString() == this.Context?.CurrentConnectionConfig?.ConfigId+"")
|
else if (attr.configId.ObjToString() == this.Context?.CurrentConnectionConfig?.ConfigId + "")
|
||||||
{
|
{
|
||||||
return GetEntityInfo(type);
|
return _GetEntityInfo(type);
|
||||||
}
|
}
|
||||||
else if (this.Context.Root == null)
|
else if (this.Context.Root == null)
|
||||||
{
|
{
|
||||||
return GetEntityInfo(type);
|
return _GetEntityInfo(type);
|
||||||
}
|
}
|
||||||
else if (!this.Context.Root.IsAnyConnection(attr.configId))
|
else if (!this.Context.Root.IsAnyConnection(attr.configId))
|
||||||
{
|
{
|
||||||
return GetEntityInfo(type);
|
return _GetEntityInfo(type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return this.Context.Root.GetConnection(attr.configId).EntityMaintenance.GetEntityInfo(type);
|
return this.Context.Root.GetConnection(attr.configId).EntityMaintenance.GetEntityInfo(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public EntityInfo GetEntityInfo(Type type)
|
|
||||||
|
private EntityInfo _GetEntityInfo(Type type)
|
||||||
{
|
{
|
||||||
string cacheKey = "GetEntityInfo" + type.GetHashCode() + type.FullName+this.Context?.CurrentConnectionConfig?.ConfigId;
|
string cacheKey = "GetEntityInfo" + type.GetHashCode() + type.FullName + this.Context?.CurrentConnectionConfig?.ConfigId;
|
||||||
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
|
@@ -698,7 +698,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(OrderByValue)&&this.IsSqlQuery&&this.OldSql.HasValue() && (Skip == null && Take == null) && (this.WhereInfos == null || this.WhereInfos.Count == 0))
|
if (this.JoinQueryInfos.Count==0&&string.IsNullOrEmpty(OrderByValue)&&this.IsSqlQuery&&this.OldSql.HasValue() && (Skip == null && Take == null) && (this.WhereInfos == null || this.WhereInfos.Count == 0))
|
||||||
{
|
{
|
||||||
return this.OldSql;
|
return this.OldSql;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user