mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
Synchronization code
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugar</id>
|
||||
<version>5.1.4.155</version>
|
||||
<version>5.1.4.157-preview13</version>
|
||||
<title>.Net Framework 安装此版本, 5.0.3.3-max 最低要求 .Net Framework 4.6 | 5.0.0.2-5.0.3.2 最低要求 .Net Framework 4.5 | 4.0-4.9.11 最低要求 .Net Framework 4.0+ .NET ORM </title>
|
||||
<authors>sun kaixuan</authors>
|
||||
<owners>landa</owners>
|
||||
|
@@ -75,7 +75,7 @@ namespace SqlSugar
|
||||
children = children.Distinct().ToList();
|
||||
Check.ExceptionEasy(pkColumn == null, typeof(TChild).Name + " has no primary key", typeof(TChild).Name + "没有主键");
|
||||
var whereName = pkColumn.PropertyName;
|
||||
if (_Options.OneToOneSaveByPrimaryKey&& pkColumn.IsPrimarykey==false)
|
||||
if (_Options?.OneToOneSaveByPrimaryKey==true&& pkColumn.IsPrimarykey==false)
|
||||
{
|
||||
var newPkColumn=this._Context.EntityMaintenance.GetEntityInfo<TChild>().Columns.FirstOrDefault(it => it.IsPrimarykey);
|
||||
if (newPkColumn != null)
|
||||
@@ -115,7 +115,7 @@ namespace SqlSugar
|
||||
{
|
||||
ignoreColumns.AddRange(pk.Select(it=>it.PropertyName));
|
||||
}
|
||||
if (_Options.OneToOneSaveByPrimaryKey)
|
||||
if (_Options?.OneToOneSaveByPrimaryKey==true)
|
||||
{
|
||||
ignoreColumns = ignoreColumns.Where(it => it != whereName).ToList();
|
||||
}
|
||||
|
Reference in New Issue
Block a user