Browse Source

Synchronization code

pull/40/head
sunkaixuan 1 year ago
parent
commit
0fbe8237b1
  1. 11
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 24
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider02-05.cs
  3. 1
      Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/SplitTableUpdateByObjectProvider.cs
  4. 4
      Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs

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

@ -901,6 +901,17 @@ namespace SqlSugar
if (list == null) return default(T);
else return list.SingleOrDefault();
}
public ISugarQueryable<T> InIF<TParamter>(bool isIn,string fieldName, params TParamter[] pkValues)
{
if (isIn)
{
return In(fieldName, pkValues);
}
else
{
return this;
}
}
public ISugarQueryable<T> InIF<TParamter>(bool isIn, params TParamter[] pkValues)
{
if (isIn)

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

@ -440,6 +440,14 @@ namespace SqlSugar
#endregion
#region In
public new ISugarQueryable<T,T2> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues)
{
if (isIn)
{
In(fieldName, pkValues);
}
return this;
}
public new ISugarQueryable<T, T2> InIF<TParamter>(bool isIn, params TParamter[] pkValues)
{
if (isIn)
@ -1133,6 +1141,14 @@ namespace SqlSugar
#endregion
#region In
public new ISugarQueryable<T, T2,T3> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues)
{
if (isIn)
{
In(fieldName, pkValues);
}
return this;
}
public new ISugarQueryable<T, T2, T3> InIF<TParamter>(bool isIn, params TParamter[] pkValues)
{
if (isIn)
@ -1843,6 +1859,14 @@ namespace SqlSugar
#endregion
#region In
public new ISugarQueryable<T, T2, T3,T4> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues)
{
if (isIn)
{
In(fieldName, pkValues);
}
return this;
}
public new ISugarQueryable<T, T2, T3, T4> InIF<TParamter>(bool isIn, params TParamter[] pkValues)
{
if (isIn)

1
Src/Asp.NetCore2/SqlSugar/Abstract/UpdateProvider/SplitTableUpdateByObjectProvider.cs

@ -42,6 +42,7 @@ namespace SqlSugar
{
var addList = item.Select(it => it.Item).ToList();
result += await this.Context.Updateable(addList)
.UpdateColumns(updateobj.UpdateBuilder.UpdateColumns?.ToArray())
.IgnoreColumns(this.updateobj.UpdateBuilder.IsNoUpdateNull, this.updateobj.UpdateBuilder.IsOffIdentity, this.updateobj.UpdateBuilder.IsNoUpdateDefaultValue)
.IgnoreColumns(GetIgnoreColumns()).AS(item.Key).ExecuteCommandAsync();
}

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

@ -95,6 +95,7 @@ namespace SqlSugar
T InSingle(object pkValue);
Task<T> InSingleAsync(object pkValue);
ISugarQueryable<T> In<TParamter>(params TParamter[] pkValues);
ISugarQueryable<T> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues);
ISugarQueryable<T> InIF<TParamter>(bool isIn,params TParamter[] pkValues);
ISugarQueryable<T> In<FieldType>(string InFieldName, params FieldType[] inValues);
ISugarQueryable<T> In<FieldType>(Expression<Func<T, object>> expression, params FieldType[] inValues);
@ -371,6 +372,7 @@ namespace SqlSugar
ISugarQueryable<T, T2> In<FieldType>(Expression<Func<T,T2, object>> expression, List<FieldType> inValues);
ISugarQueryable<T, T2> In<FieldType>(Expression<Func<T,T2, object>> expression, ISugarQueryable<FieldType> childQueryExpression);
new ISugarQueryable<T,T2> InIF<TParamter>(bool isIn, params TParamter[] pkValues);
new ISugarQueryable<T,T2> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues);
#endregion
#region Other
@ -506,6 +508,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3> In<FieldType>(Expression<Func<T, T2,T3, object>> expression, ISugarQueryable<FieldType> childQueryExpression);
new ISugarQueryable<T, T2,T3> InIF<TParamter>(bool isIn, params TParamter[] pkValues);
new ISugarQueryable<T, T2,T3> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues);
#endregion
#region Other
@ -647,6 +650,7 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4> In<FieldType>(Expression<Func<T, T2, T3,T4, object>> expression, ISugarQueryable<FieldType> childQueryExpression);
new ISugarQueryable<T, T2,T3,T4> InIF<TParamter>(bool isIn, params TParamter[] pkValues);
new ISugarQueryable<T, T2, T3,T4> InIF<TParamter>(bool isIn, string fieldName, params TParamter[] pkValues);
#endregion
#region Other

Loading…
Cancel
Save