我的 DTO 中有一个整数字段。在数据库中,有一些数字存储为 1、2、101 等。我想确保在系统中它们始终显示为三位,例如 001、002。这不起作用,我不知道该怎么做......有什么想法吗?这是我的 DTO 的片段:
Private mArea As Integer
<Display(name:="Area")> _
<DisplayFormat(DataformatString:="{0:000}")> _
Public Property Area() As Integer
Get
Return mArea
End Get
Set(ByVal value As Integer)
mArea = value
End Set
End Property