mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Add InsertColumns
This commit is contained in:
@@ -184,6 +184,12 @@ namespace SqlSugar
|
||||
return this;
|
||||
}
|
||||
|
||||
public IInsertable<T> InsertColumns(string[] columns)
|
||||
{
|
||||
this.InsertBuilder.DbColumnInfoList = this.InsertBuilder.DbColumnInfoList.Where(it => columns.Any(ig => ig.Equals(it.PropertyName, StringComparison.CurrentCultureIgnoreCase))).ToList();
|
||||
return this;
|
||||
}
|
||||
|
||||
public IInsertable<T> InsertColumns(Func<string, bool> insertColumMethod)
|
||||
{
|
||||
this.InsertBuilder.DbColumnInfoList = this.InsertBuilder.DbColumnInfoList.Where(it => insertColumMethod(it.PropertyName)).ToList();
|
||||
|
@@ -23,6 +23,7 @@ namespace SqlSugar
|
||||
IInsertable<T> AS(string tableName);
|
||||
IInsertable<T> With(string lockString);
|
||||
IInsertable<T> InsertColumns(Expression<Func<T, object>> columns);
|
||||
IInsertable<T> InsertColumns(string[] columns);
|
||||
IInsertable<T> InsertColumns(Func<string, bool> insertColumMethod);
|
||||
IInsertable<T> IgnoreColumns(Expression<Func<T, object>> columns);
|
||||
IInsertable<T> IgnoreColumns(Func<string,bool> ignoreColumMethod);
|
||||
|
Reference in New Issue
Block a user