From fb80fd0b5a903c4cc8096960a066c48d4fbd18e9 Mon Sep 17 00:00:00 2001 From: Soar360 Date: Mon, 11 Nov 2024 21:12:21 +0800 Subject: [PATCH] Update EntityBuilder.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生成关联映射时,如果类型不是字符,则返回 default 而不是 0 . --- XCode/Code/EntityBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XCode/Code/EntityBuilder.cs b/XCode/Code/EntityBuilder.cs index 4f4fe8108..6ef3df33b 100644 --- a/XCode/Code/EntityBuilder.cs +++ b/XCode/Code/EntityBuilder.cs @@ -988,7 +988,7 @@ protected virtual void BuildMap() else if (mapName.DataType == typeof(String)) WriteLine("public {3} {0} => {1}?.{2};", myName, name, mapName.Name, type); else - WriteLine("public {3} {0} => {1} != null ? {1}.{2} : 0;", myName, name, mapName.Name, mapName.DataType.Name); + WriteLine("public {3} {0} => {1} != null ? {1}.{2} : default;", myName, name, mapName.Name, mapName.DataType.Name); } } @@ -2081,4 +2081,4 @@ private Boolean IsDataTime(IDataColumn column) return false; } #endregion -} \ No newline at end of file +}