mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Core
This commit is contained in:
parent
03504fdcbe
commit
68e93c5402
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,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,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,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,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…
Reference in New Issue
Block a user