mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Synchronization code
This commit is contained in:
@@ -1528,7 +1528,7 @@ namespace SqlSugar
|
||||
asyncQueryableBuilder.SelectValue = this.QueryBuilder.SelectValue;
|
||||
asyncQueryableBuilder.WhereInfos = this.Context.Utilities.TranslateCopy(this.QueryBuilder.WhereInfos);
|
||||
asyncQueryableBuilder.EasyJoinInfos = this.Context.Utilities.TranslateCopy(this.QueryBuilder.EasyJoinInfos);
|
||||
asyncQueryableBuilder.JoinQueryInfos = this.Context.Utilities.TranslateCopy(this.QueryBuilder.JoinQueryInfos);
|
||||
asyncQueryableBuilder.JoinQueryInfos = QueryBuilder.JoinQueryInfos.Select(it => CopyJoinInfo(it)).ToList();
|
||||
asyncQueryableBuilder.WhereIndex = this.QueryBuilder.WhereIndex;
|
||||
asyncQueryableBuilder.EntityType = this.QueryBuilder.EntityType;
|
||||
asyncQueryableBuilder.EntityName = this.QueryBuilder.EntityName;
|
||||
@@ -1553,11 +1553,25 @@ namespace SqlSugar
|
||||
asyncQueryableBuilder.OldSql = this.QueryBuilder.OldSql;
|
||||
asyncQueryableBuilder.IsCrossQueryWithAttr = this.QueryBuilder.IsCrossQueryWithAttr;
|
||||
asyncQueryableBuilder.CrossQueryItems = this.QueryBuilder.CrossQueryItems;
|
||||
asyncQueryableBuilder.SubToListParameters= this.Context.Utilities.TranslateCopy(this.QueryBuilder.SubToListParameters);
|
||||
asyncQueryableBuilder.SubToListParameters = this.Context.Utilities.TranslateCopy(this.QueryBuilder.SubToListParameters);
|
||||
asyncQueryableBuilder.AppendColumns = this.Context.Utilities.TranslateCopy(this.QueryBuilder.AppendColumns);
|
||||
asyncQueryableBuilder.AppendValues = this.Context.Utilities.TranslateCopy(this.QueryBuilder.AppendValues);
|
||||
asyncQueryableBuilder.RemoveFilters = this.QueryBuilder.RemoveFilters?.ToArray();
|
||||
}
|
||||
|
||||
private static JoinQueryInfo CopyJoinInfo(JoinQueryInfo it)
|
||||
{
|
||||
return new JoinQueryInfo()
|
||||
{
|
||||
EntityType = it.EntityType,
|
||||
JoinIndex = it.JoinIndex,
|
||||
JoinType = it.JoinType,
|
||||
JoinWhere = it.JoinWhere,
|
||||
ShortName = it.ShortName,
|
||||
TableName = it.TableName
|
||||
};
|
||||
}
|
||||
|
||||
protected int SetCacheTime(int cacheDurationInSeconds)
|
||||
{
|
||||
if (cacheDurationInSeconds == int.MaxValue && this.Context.CurrentConnectionConfig.MoreSettings != null && this.Context.CurrentConnectionConfig.MoreSettings.DefaultCacheDurationInSeconds > 0)
|
||||
|
@@ -327,7 +327,10 @@ namespace SqlSugar
|
||||
string shortName = string.Empty;
|
||||
List<SugarParameter> paramters = new List<SugarParameter>();
|
||||
queryable.SqlBuilder.QueryBuilder.JoinQueryInfos = this.GetJoinInfos(queryable.SqlBuilder, joinExpression, ref paramters, ref shortName, types);
|
||||
queryable.SqlBuilder.QueryBuilder.JoinQueryInfos.Last().EntityType = types.Last();
|
||||
if (queryable.SqlBuilder.QueryBuilder.JoinQueryInfos.Any())
|
||||
{
|
||||
queryable.SqlBuilder.QueryBuilder.JoinQueryInfos.Last().EntityType = types.Last();
|
||||
}
|
||||
queryable.SqlBuilder.QueryBuilder.TableShortName = shortName;
|
||||
queryable.SqlBuilder.QueryBuilder.JoinExpression = joinExpression;
|
||||
if (paramters != null)
|
||||
|
@@ -1561,6 +1561,14 @@ namespace SqlSugar
|
||||
};
|
||||
return result;
|
||||
}
|
||||
public SplitTableContext SplitHelper(Type entityType)
|
||||
{
|
||||
var result = new SplitTableContext(this.Context)
|
||||
{
|
||||
EntityInfo = this.Context.EntityMaintenance.GetEntityInfo(entityType)
|
||||
};
|
||||
return result;
|
||||
}
|
||||
public SplitTableContextResult<T> SplitHelper<T>(T data) where T : class, new()
|
||||
{
|
||||
var result = new SplitTableContext(this.Context)
|
||||
|
@@ -689,6 +689,10 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.SplitHelper<T>();
|
||||
}
|
||||
public SplitTableContext SplitHelper(Type entityType)
|
||||
{
|
||||
return ScopedContext.SplitHelper(entityType);
|
||||
}
|
||||
public SplitTableContextResult<T> SplitHelper<T>(T data) where T : class, new()
|
||||
{
|
||||
return ScopedContext.SplitHelper(data);
|
||||
|
@@ -50,6 +50,7 @@ namespace SqlSugar
|
||||
SqlSugarClient CopyNew();
|
||||
T CreateContext<T>(bool isTran=true) where T : SugarUnitOfWork, new();
|
||||
SugarUnitOfWork CreateContext(bool isTran = true);
|
||||
SplitTableContext SplitHelper(Type entityType);
|
||||
SplitTableContext SplitHelper<T>() where T : class, new();
|
||||
SplitTableContextResult<T> SplitHelper<T>(T data) where T : class, new();
|
||||
SplitTableContextResult<T> SplitHelper<T>(List<T> data) where T : class, new();
|
||||
|
@@ -1181,6 +1181,10 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.SplitHelper<T>();
|
||||
}
|
||||
public SplitTableContext SplitHelper(Type entityType)
|
||||
{
|
||||
return this.Context.SplitHelper(entityType);
|
||||
}
|
||||
public SplitTableContextResult<T> SplitHelper<T>(T data) where T : class, new()
|
||||
{
|
||||
return this.Context.SplitHelper(data);
|
||||
|
@@ -685,6 +685,10 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.SplitHelper<T>();
|
||||
}
|
||||
public SplitTableContext SplitHelper(Type entityType)
|
||||
{
|
||||
return ScopedContext.SplitHelper(entityType);
|
||||
}
|
||||
public SplitTableContextResult<T> SplitHelper<T>(T data) where T : class, new()
|
||||
{
|
||||
return ScopedContext.SplitHelper(data);
|
||||
|
Reference in New Issue
Block a user