mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-01 19:03:58 +08:00
Update nav insert
This commit is contained in:
@@ -195,7 +195,18 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this._Context.Insertable(insertData).ExecuteCommand();
|
var isIdentity = this._Context.EntityMaintenance.GetEntityInfo(typeof(TChild)).Columns.Any(it => it.IsIdentity);
|
||||||
|
if (isIdentity)
|
||||||
|
{
|
||||||
|
foreach (var item in insertData)
|
||||||
|
{
|
||||||
|
this._Context.Insertable(insertData).ExecuteCommandIdentityIntoEntity();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._Context.Insertable(insertData).ExecuteCommand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user