mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 修复 FreeSql.Generator 默认值 NULL 处理问题;#645
This commit is contained in:
parent
02785f4b8a
commit
013eec2264
@ -220,6 +220,7 @@ public class RazorModel {
|
|||||||
if (defval.StartsWith("N'") && defval.EndsWith("'")) defval = defval.Substring(1);
|
if (defval.StartsWith("N'") && defval.EndsWith("'")) defval = defval.Substring(1);
|
||||||
if (cstype == typeof(Guid) && string.Compare(defval, "newid()", true) == 0) return $"Guid.NewGuid()";
|
if (cstype == typeof(Guid) && string.Compare(defval, "newid()", true) == 0) return $"Guid.NewGuid()";
|
||||||
if (cstype == typeof(string) && string.Compare(defval, "newid()", true) == 0) return $"Guid.NewGuid().ToString().ToUpper()";
|
if (cstype == typeof(string) && string.Compare(defval, "newid()", true) == 0) return $"Guid.NewGuid().ToString().ToUpper()";
|
||||||
|
if (defval == "NULL") return null;
|
||||||
}
|
}
|
||||||
if ((cstype == typeof(string) && defval.StartsWith("'") && defval.EndsWith("'::character varying") ||
|
if ((cstype == typeof(string) && defval.StartsWith("'") && defval.EndsWith("'::character varying") ||
|
||||||
cstype == typeof(Guid) && defval.StartsWith("'") && defval.EndsWith("'::uuid")
|
cstype == typeof(Guid) && defval.StartsWith("'") && defval.EndsWith("'::uuid")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user