@ -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));
public IUpdateable<T> Where(List<IConditionalModel> conditionalModels)
Check.Exception(UpdateObjectNotWhere() && UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("update List no support where", "集合更新不支持Where请使用WhereColumns"));
#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>
<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>
<id>SqlSugarCore.MySqlConnector</id>
<id>SqlSugarCoreNoDrive</id>