mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update InsertNav
This commit is contained in:
parent
51f89e37ae
commit
0937565930
@ -96,6 +96,17 @@ namespace SqlSugar
|
||||
}
|
||||
this._Context.Insertable(insertData).ExecuteCommand();
|
||||
}
|
||||
else if (pkColumn.UnderType == UtilConstants.GuidType && pkColumn.IsIdentity == false)
|
||||
{
|
||||
foreach (var child in insertData)
|
||||
{
|
||||
if (IsDefaultValue(pkColumn.PropertyInfo.GetValue(child)))
|
||||
{
|
||||
pkColumn.PropertyInfo.SetValue(child, Guid.NewGuid());
|
||||
}
|
||||
}
|
||||
this._Context.Insertable(insertData).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Context.Insertable(insertData).ExecuteCommand();
|
||||
|
Loading…
Reference in New Issue
Block a user