mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
BUG
This commit is contained in:
@@ -243,11 +243,16 @@ namespace SqlSugar
|
|||||||
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey && it.UnderType == UtilConstants.LongType);
|
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey && it.UnderType == UtilConstants.LongType);
|
||||||
if (snowColumn!=null)
|
if (snowColumn!=null)
|
||||||
{
|
{
|
||||||
var id = this.ExecuteReturnSnowflakeId();
|
;
|
||||||
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
|
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
|
||||||
{
|
{
|
||||||
|
var id = this.ExecuteReturnSnowflakeId();
|
||||||
snowColumn.PropertyInfo.SetValue(result, id);
|
snowColumn.PropertyInfo.SetValue(result, id);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ExecuteCommand();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -311,11 +316,16 @@ namespace SqlSugar
|
|||||||
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey&& it.UnderType == UtilConstants.LongType);
|
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey&& it.UnderType == UtilConstants.LongType);
|
||||||
if (snowColumn != null)
|
if (snowColumn != null)
|
||||||
{
|
{
|
||||||
var id =await this.ExecuteReturnSnowflakeIdAsync();
|
|
||||||
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
|
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
|
||||||
{
|
{
|
||||||
|
var id = await this.ExecuteReturnSnowflakeIdAsync();
|
||||||
snowColumn.PropertyInfo.SetValue(result, id);
|
snowColumn.PropertyInfo.SetValue(result, id);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await this.ExecuteCommandAsync();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user