Browse Source

UpdateColumns(string[] columns)

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
09c275fadf
  1. 6
      Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs
  2. 1
      Src/Asp.Net/SqlSugar/Interface/IUpdateable.cs

6
Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -211,6 +211,12 @@ namespace SqlSugar
return this;
}
public IUpdateable<T> UpdateColumns(string[] columns)
{
this.UpdateBuilder.DbColumnInfoList = this.UpdateBuilder.DbColumnInfoList.Where(it => columns.Contains(it.PropertyName, StringComparer.OrdinalIgnoreCase)).ToList();
return this;
}
public IUpdateable<T> UpdateColumns(Func<string, bool> updateColumMethod)
{
List<string> primaryKeys = GetPrimaryKeys();

1
Src/Asp.Net/SqlSugar/Interface/IUpdateable.cs

@ -41,6 +41,7 @@ namespace SqlSugar
IUpdateable<T> UpdateColumns(Expression<Func<T, object>> columns);
IUpdateable<T> UpdateColumns(Expression<Func<T, bool>> columns);
IUpdateable<T> UpdateColumns(Func<string, bool> updateColumMethod);
IUpdateable<T> UpdateColumns(string[] columns);
IUpdateable<T> UpdateColumns(Expression<Func<T, T>> columns);
IUpdateable<T> UpdateColumnsIF(bool isUpdateColumns,Expression<Func<T, object>> columns);
IUpdateable<T> UpdateColumnsIF(bool isUpdateColumns,Expression<Func<T, bool>> columns);

Loading…
Cancel
Save