Optimize the code

This commit is contained in:
sunkaixuan
2025-05-08 15:49:33 +08:00
parent ef2ed0df5f
commit e59c97a4b6

View File

@@ -42,7 +42,7 @@ namespace SqlSugar
foreach (var item in InsertBuilder.DbColumnInfoList)
{
var isPk = pks.Any(y => y.Equals(item.DbColumnName, StringComparison.CurrentCultureIgnoreCase)) || item.IsPrimarykey;
if (isPk && item.Value is Guid guid && guid == Guid.Empty)
if (isPk && item.PropertyType == UtilConstants.GuidType && item.Value is Guid guid && guid == Guid.Empty)
{
if (StaticConfig.CustomGuidFunc != null)
{