Skip to content

Commit

Permalink
Update EntityBuilder.cs
Browse files Browse the repository at this point in the history
生成关联映射时,如果类型不是字符,则返回 default 而不是 0 .
  • Loading branch information
Soar360 authored Nov 11, 2024
1 parent 07f7d3e commit fb80fd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions XCode/Code/EntityBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -2081,4 +2081,4 @@ private Boolean IsDataTime(IDataColumn column)
return false;
}
#endregion
}
}

0 comments on commit fb80fd0

Please sign in to comment.