Browse Source

Synchronization code

pull/23/head
sunkaixuan 2 years ago
parent
commit
ffae680f87
  1. 17
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 35
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs
  3. 2
      Src/Asp.NetCore2/SqlSugar/Entities/DeleteNavOptions.cs
  4. 3
      Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs

17
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -97,6 +97,23 @@ namespace SqlSugar
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2> FullJoin<T2>(ISugarQueryable<T2> joinQueryable, Expression<Func<T, T2, bool>> joinExpression)
{
this.Context.InitMappingInfo<T2>();
var result = InstanceFactory.GetQueryable<T, T2>(this.Context.CurrentConnectionConfig);
result.SqlBuilder = this.SqlBuilder;
result.Context = this.Context;
var joinInfo = GetJoinInfo(joinExpression, JoinType.Full);
var sqlObject = joinQueryable.ToSql();
string sql = sqlObject.Key;
this.QueryBuilder.LambdaExpressions.ParameterIndex += 100;
UtilMethods.RepairReplicationParameters(ref sql, sqlObject.Value.ToArray(), this.QueryBuilder.LambdaExpressions.ParameterIndex, "");
joinInfo.TableName = "(" + sql + ")";
this.QueryBuilder.Parameters.AddRange(sqlObject.Value);
result.QueryBuilder.JoinQueryInfos.Add(joinInfo);
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2> LeftJoin<T2>(Expression<Func<T, T2, bool>> joinExpression)
{
this.Context.InitMappingInfo<T2>();

35
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs

@ -66,6 +66,24 @@ namespace SqlSugar
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2, T3> FullJoin<T3>(ISugarQueryable<T3> joinQueryable, Expression<Func<T, T2, T3, bool>> joinExpression)
{
this.Context.InitMappingInfo<T3>();
var result = InstanceFactory.GetQueryable<T, T2, T3>(this.Context.CurrentConnectionConfig);
result.SqlBuilder = this.SqlBuilder;
result.Context = this.Context;
var joinInfo = GetJoinInfo(joinExpression, JoinType.Full);
var sqlObject = joinQueryable.ToSql();
string sql = sqlObject.Key;
this.QueryBuilder.LambdaExpressions.ParameterIndex += 100;
UtilMethods.RepairReplicationParameters(ref sql, sqlObject.Value.ToArray(), this.QueryBuilder.LambdaExpressions.ParameterIndex, "");
joinInfo.TableName = "(" + sql + ")";
this.QueryBuilder.Parameters.AddRange(sqlObject.Value);
result.QueryBuilder.JoinQueryInfos.Add(joinInfo);
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2, T3> LeftJoin<T3>(Expression<Func<T, T2, T3, bool>> joinExpression)
{
this.Context.InitMappingInfo<T3>();
@ -553,6 +571,23 @@ namespace SqlSugar
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2, T3, T4> FullJoin<T4>(ISugarQueryable<T4> joinQueryable, Expression<Func<T, T2, T3, T4, bool>> joinExpression)
{
this.Context.InitMappingInfo<T4>();
var result = InstanceFactory.GetQueryable<T, T2, T3, T4>(this.Context.CurrentConnectionConfig);
result.SqlBuilder = this.SqlBuilder;
result.Context = this.Context;
var joinInfo = GetJoinInfo(joinExpression, JoinType.Full);
var sqlObject = joinQueryable.ToSql();
string sql = sqlObject.Key;
this.QueryBuilder.LambdaExpressions.ParameterIndex += 100;
UtilMethods.RepairReplicationParameters(ref sql, sqlObject.Value.ToArray(), this.QueryBuilder.LambdaExpressions.ParameterIndex, "");
joinInfo.TableName = "(" + sql + ")";
this.QueryBuilder.Parameters.AddRange(sqlObject.Value);
result.QueryBuilder.JoinQueryInfos.Add(joinInfo);
result.QueryBuilder.LambdaExpressions.ParameterIndex = this.QueryBuilder.LambdaExpressions.ParameterIndex;
return result;
}
public ISugarQueryable<T, T2, T3, T4> LeftJoin<T4>(Expression<Func<T, T2, T3, T4, bool>> joinExpression)
{
this.Context.InitMappingInfo<T4>();

2
Src/Asp.NetCore2/SqlSugar/Entities/DeleteNavOptions.cs

@ -24,7 +24,7 @@ namespace SqlSugar
}
public class UpdateNavRootOptions
{
public string IgnoreColumns { get; set; }
public string[] IgnoreColumns { get; set; }
public string[] UpdateColumns { get; set; }
public bool IsInsertRoot { get; set; }
public bool IsDiffLogEvent { get; set; }

3
Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs

@ -26,6 +26,7 @@ namespace SqlSugar
ISugarQueryable<T, T2> LeftJoin<T2>(ISugarQueryable<T2> joinQueryable, Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T, T2> InnerJoin<T2>(ISugarQueryable<T2> joinQueryable, Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T, T2> RightJoin<T2>(ISugarQueryable<T2> joinQueryable, Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T, T2> FullJoin<T2>(ISugarQueryable<T2> joinQueryable, Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T,T2> LeftJoin<T2>(Expression<Func<T,T2,bool>> joinExpression);
ISugarQueryable<T, T2> FullJoin<T2>(Expression<Func<T, T2, bool>> joinExpression);
ISugarQueryable<T, T2> InnerJoin<T2>(Expression<Func<T, T2, bool>> joinExpression);
@ -219,6 +220,7 @@ namespace SqlSugar
ISugarQueryable<T, T2,T3> LeftJoin<T3>(ISugarQueryable<T3> joinQueryable, Expression<Func<T, T2,T3, bool>> joinExpression);
ISugarQueryable<T, T2,T3> InnerJoin<T3>(ISugarQueryable<T3> joinQueryable, Expression<Func<T, T2,T3, bool>> joinExpression);
ISugarQueryable<T, T2,T3> RightJoin<T3>(ISugarQueryable<T3> joinQueryable, Expression<Func<T, T2,T3, bool>> joinExpression);
ISugarQueryable<T, T2, T3> FullJoin<T3>(ISugarQueryable<T3> joinQueryable, Expression<Func<T, T2, T3, bool>> joinExpression);
ISugarQueryable<T, T2,T3> LeftJoin<T3>(Expression<Func<T,T2,T3,bool>> joinExpression);
ISugarQueryable<T, T2, T3> FullJoin<T3>(Expression<Func<T, T2, T3, bool>> joinExpression);
ISugarQueryable<T, T2, T3> InnerJoin<T3>(Expression<Func<T, T2, T3, bool>> joinExpression);
@ -322,6 +324,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3,T4> LeftJoin<T4>(ISugarQueryable<T4> joinQueryable, Expression<Func<T, T2, T3,T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3,T4> InnerJoin<T4>(ISugarQueryable<T4> joinQueryable, Expression<Func<T, T2, T3,T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3,T4> RightJoin<T4>(ISugarQueryable<T4> joinQueryable, Expression<Func<T, T2, T3,T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3, T4> FullJoin<T4>(ISugarQueryable<T4> joinQueryable, Expression<Func<T, T2, T3, T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3,T4> LeftJoin<T4>(Expression<Func<T, T2, T3,T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3, T4> FullJoin<T4>(Expression<Func<T, T2, T3, T4, bool>> joinExpression);
ISugarQueryable<T, T2, T3,T4> InnerJoin<T4>(Expression<Func<T, T2, T3,T4, bool>> joinExpression);

Loading…
Cancel
Save