Browse Source

Update Core

pull/4/MERGE
sunkaixuna 3 years ago
parent
commit
68e93c5402
  1. 7
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs
  2. 8
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs
  3. 1
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConditionalModel.cs
  4. 1
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/IDeleteable.cs
  5. 1
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/IUpdateable.cs
  6. 2
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugar.csproj
  7. 2
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCore.nuspec
  8. 2
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCoreMySqlConnector.nuspec
  9. 2
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCoreNoDrive.nuspec

7
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

@ -220,6 +220,13 @@ namespace SqlSugar
DeleteBuilder.Parameters.AddRange(parameters);
return this;
}
public IDeleteable<T> Where(List<IConditionalModel> conditionalModels)
{
var sql = this.Context.Queryable<T>().SqlBuilder.ConditionalModelToSql(conditionalModels);
var result = this;
result.Where(sql.Key, sql.Value);
return result;
}
public IDeleteable<T> WhereColumns(Expression<Func<T, object>> columns)
{

8
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -367,6 +367,14 @@ namespace SqlSugar
this.UpdateBuilder.Parameters.Add(new SugarParameter(parameterName, fieldValue));
return this;
}
public IUpdateable<T> Where(List<IConditionalModel> conditionalModels)
{
Check.Exception(UpdateObjectNotWhere() && UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("update List no support where", "集合更新不支持Where请使用WhereColumns"));
var sql = this.Context.Queryable<T>().SqlBuilder.ConditionalModelToSql(conditionalModels);
var result = this;
result.Where(sql.Key, sql.Value);
return result;
}
#endregion
#region Helper

1
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Entities/ConditionalModel.cs

@ -22,6 +22,7 @@ namespace SqlSugar
public string FieldName { get; set; }
public string FieldValue { get; set; }
public ConditionalType ConditionalType { get; set; }
[Newtonsoft.Json.JsonIgnoreAttribute]
public Func<string,object> FieldValueConvertFunc { get; set; }
}
}

1
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/IDeleteable.cs

@ -30,6 +30,7 @@ namespace SqlSugar
IDeleteable<T> Where(string whereString, SugarParameter[] parameters);
IDeleteable<T> Where(string whereString, List<SugarParameter> parameters);
IDeleteable<T> WhereColumns(Expression<Func<T, object>> columns);
IDeleteable<T> Where(List<IConditionalModel> conditionalModels);
IDeleteable<T> EnableDiffLogEvent(object businessData = null);
IDeleteable<T> RemoveDataCache();
IDeleteable<T> RemoveDataCache(string likeString);

1
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Interface/IUpdateable.cs

@ -43,6 +43,7 @@ namespace SqlSugar
IUpdateable<T> WhereColumns(Expression<Func<T, object>> columns);
IUpdateable<T> WhereColumns(string columnName);
IUpdateable<T> WhereColumns(params string [] columnNames);
IUpdateable<T> Where(List<IConditionalModel> conditionalModels);
/// <summary>
/// .UpdateColumns(it=>new{ it.Name,it.Price})

2
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugar.csproj

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>5.0.3.4</Version>
<Version>5.0.3.5</Version>
<Copyright>sun_kai_xuan</Copyright>
<PackageProjectUrl>https://github.com/sunkaixuan/SqlSugar</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>

2
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCore.nuspec

@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore</id>
<version>5.0.3.4</version>
<version>5.0.3.5</version>
<authors>sunkaixuan</authors>
<owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

2
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCoreMySqlConnector.nuspec

@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCore.MySqlConnector</id>
<version>5.0.3.4</version>
<version>5.0.3.5</version>
<authors>sunkaixuan</authors>
<owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

2
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/SqlSugarForCoreNoDrive.nuspec

@ -2,7 +2,7 @@
<package >
<metadata>
<id>SqlSugarCoreNoDrive</id>
<version>5.0.3.4</version>
<version>5.0.3.5</version>
<authors>sunkaixuan</authors>
<owners>Landa</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

Loading…
Cancel
Save