mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- FreeSql.Generator DefaultValue
This commit is contained in:
parent
4b875eaf7c
commit
3014e6faf0
@ -218,6 +218,8 @@ public class RazorModel {
|
|||||||
else if (defval.StartsWith("(") && defval.EndsWith(")")) defval = defval.Substring(1, defval.Length - 2);
|
else if (defval.StartsWith("(") && defval.EndsWith(")")) defval = defval.Substring(1, defval.Length - 2);
|
||||||
else return null;
|
else return null;
|
||||||
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(string) && string.Compare(defval, "newid()", true) == 0) return $"Guid.NewGuid().ToString().ToUpper()";
|
||||||
}
|
}
|
||||||
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