mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Synchronization code
This commit is contained in:
@@ -97,6 +97,10 @@ namespace SqlSugar
|
||||
{
|
||||
var pk= this._Context.EntityMaintenance.GetEntityInfo<TChild>().Columns.Where(it => it.IsPrimarykey);
|
||||
List<string> ignoreColumns = new List<string>();
|
||||
if (_Options?.IgnoreColumns != null)
|
||||
{
|
||||
ignoreColumns.AddRange(_Options.IgnoreColumns);
|
||||
}
|
||||
if (pk.Any())
|
||||
{
|
||||
ignoreColumns.AddRange(pk.Select(it=>it.PropertyName));
|
||||
@@ -112,13 +116,14 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
var ignoreColumns = _Options?.IgnoreColumns;
|
||||
if (IsDeleted)
|
||||
{
|
||||
x.AsUpdateable.PageSize(1).EnableQueryFilter().ExecuteCommand();
|
||||
x.AsUpdateable.IgnoreColumns(ignoreColumns?.ToArray()).PageSize(1).EnableQueryFilter().ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
x.AsUpdateable.ExecuteCommand();
|
||||
x.AsUpdateable.IgnoreColumns(ignoreColumns?.ToArray()).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
InitData(pkColumn, insertData);
|
||||
|
@@ -54,6 +54,7 @@ namespace SqlSugar
|
||||
public bool OneToManyInsertOrUpdate { get; set; }
|
||||
public Expression RootFunc { get; set; }
|
||||
public Expression CurrentFunc { get; set; }
|
||||
public string[] IgnoreColumns { get; set; }
|
||||
}
|
||||
|
||||
public class InsertNavOptions
|
||||
|
Reference in New Issue
Block a user