mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 修复 FreeSql.Generator 默认值 NULL 处理问题;#645
This commit is contained in:
		@@ -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")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user