Update .net framework project

This commit is contained in:
sunkaixuan 2022-09-14 12:16:34 +08:00
parent 8779b05a70
commit ca408014e5
2 changed files with 14 additions and 4 deletions

View File

@ -243,11 +243,16 @@ namespace SqlSugar
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey && it.UnderType == UtilConstants.LongType);
if (snowColumn!=null)
{
var id = this.ExecuteReturnSnowflakeId();
;
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
{
var id = this.ExecuteReturnSnowflakeId();
snowColumn.PropertyInfo.SetValue(result, id);
}
else
{
ExecuteCommand();
}
return true;
}
else
@ -311,11 +316,16 @@ namespace SqlSugar
var snowColumn = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey&& it.UnderType == UtilConstants.LongType);
if (snowColumn != null)
{
var id =await this.ExecuteReturnSnowflakeIdAsync();
if (Convert.ToInt64(snowColumn.PropertyInfo.GetValue(result)) == 0)
{
var id = await this.ExecuteReturnSnowflakeIdAsync();
snowColumn.PropertyInfo.SetValue(result, id);
}
else
{
await this.ExecuteCommandAsync();
}
return true;
}
else

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.1.3")]
[assembly: AssemblyFileVersion("5.1.3")]
[assembly: AssemblyVersion("5.1.3.1")]
[assembly: AssemblyFileVersion("5.1.3.1")]