Update nav query

This commit is contained in:
sunkaixuan
2025-09-12 11:25:34 +08:00
parent 683c30c23d
commit a9bd90994c
3 changed files with 12 additions and 4 deletions

View File

@@ -141,11 +141,11 @@ namespace SqlSugar
} }
else if (pkColumn.UnderType == UtilConstants.GuidType) else if (pkColumn.UnderType == UtilConstants.GuidType)
{ {
SetValue(pkColumn, insertData, () => Guid.NewGuid()); SetValue(pkColumn, insertData, () => UtilMethods.NewGuid());
} }
else if (pkColumn.UnderType == UtilConstants.StringType) else if (pkColumn.UnderType == UtilConstants.StringType)
{ {
SetValue(pkColumn, insertData, () => Guid.NewGuid().ToString()); SetValue(pkColumn, insertData, () => UtilMethods.NewGuid().ToString());
} }
else else
{ {

View File

@@ -164,11 +164,11 @@ namespace SqlSugar
} }
else if (pkColumn.UnderType == UtilConstants.GuidType) else if (pkColumn.UnderType == UtilConstants.GuidType)
{ {
SetValue(pkColumn, UpdateData, () => Guid.NewGuid()); SetValue(pkColumn, UpdateData, () => UtilMethods.NewGuid());
} }
else if (pkColumn.UnderType == UtilConstants.StringType) else if (pkColumn.UnderType == UtilConstants.StringType)
{ {
SetValue(pkColumn, UpdateData, () => Guid.NewGuid().ToString()); SetValue(pkColumn, UpdateData, () => UtilMethods.NewGuid().ToString());
} }
else else
{ {

View File

@@ -2015,5 +2015,13 @@ namespace SqlSugar
{ {
return context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings ?? new ConnMoreSettings(); return context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings ?? new ConnMoreSettings();
} }
public static object NewGuid()
{
if (StaticConfig.CustomGuidByValueFunc == null)
return Guid.NewGuid();
else
return StaticConfig.CustomGuidByValueFunc(Guid.NewGuid());
}
} }
} }