mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
UpdateNav ignore null
This commit is contained in:
@@ -168,7 +168,12 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
x.AsUpdateable.EnableDiffLogEventIF(_RootOptions.IsDiffLogEvent, _RootOptions.DiffLogBizData).ExecuteCommandWithOptLockIF(_RootOptions?.IsOptLock, _RootOptions?.IsOptLock);
|
||||
x.AsUpdateable
|
||||
.EnableDiffLogEventIF(_RootOptions.IsDiffLogEvent, _RootOptions.DiffLogBizData)
|
||||
.UpdateColumns(_RootOptions.UpdateColumns)
|
||||
.IgnoreColumns(_RootOptions.IgnoreColumns)
|
||||
.IgnoreNullColumns(_RootOptions.IsIgnoreAllNullColumns)
|
||||
.ExecuteCommandWithOptLockIF(_RootOptions?.IsOptLock, _RootOptions?.IsOptLock);
|
||||
newRoots.Add(item);
|
||||
}
|
||||
}
|
||||
@@ -180,6 +185,7 @@ namespace SqlSugar
|
||||
.EnableDiffLogEventIF(_RootOptions.IsDiffLogEvent,_RootOptions.DiffLogBizData)
|
||||
.UpdateColumns(_RootOptions.UpdateColumns)
|
||||
.IgnoreColumns(_RootOptions.IgnoreColumns)
|
||||
.IgnoreNullColumns(_RootOptions.IsIgnoreAllNullColumns)
|
||||
.ExecuteCommandWithOptLockIF(_RootOptions?.IsOptLock, _RootOptions?.IsOptLock);
|
||||
}
|
||||
}
|
||||
|
@@ -366,6 +366,17 @@ namespace SqlSugar
|
||||
if (IsIgnore) this.IgnoreColumns(columns);
|
||||
return this;
|
||||
}
|
||||
public IUpdateable<T> IgnoreNullColumns(bool isIgnoreNull = true)
|
||||
{
|
||||
if (isIgnoreNull)
|
||||
{
|
||||
return IgnoreColumns(isIgnoreNull);
|
||||
}
|
||||
else
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public IUpdateable<T> IgnoreColumns(string[] columns)
|
||||
{
|
||||
if (columns.HasValue())
|
||||
|
@@ -33,6 +33,7 @@ namespace SqlSugar
|
||||
{
|
||||
public string[] IgnoreColumns { get; set; }
|
||||
public string[] UpdateColumns { get; set; }
|
||||
public bool IsIgnoreAllNullColumns { get; set; }
|
||||
public bool IsInsertRoot { get; set; }
|
||||
public bool IsDisableUpdateRoot { get; set; }
|
||||
public bool IsDiffLogEvent { get; set; }
|
||||
|
@@ -98,7 +98,7 @@ namespace SqlSugar
|
||||
IUpdateable<T> IgnoreColumnsIF(bool isIgnore, Expression<Func<T, object>> columns);
|
||||
|
||||
IUpdateable<T> IgnoreColumns(params string[] columns);
|
||||
|
||||
IUpdateable<T> IgnoreNullColumns(bool isIgnoreNull=true);
|
||||
|
||||
|
||||
IUpdateable<T> IsEnableUpdateVersionValidation();
|
||||
|
Reference in New Issue
Block a user