How to specify a min but no max decimal using the range data annotation attribute?

后端 未结 10 1718
旧时难觅i
旧时难觅i 2021-01-31 01:02

I would like to specify that a decimal field for a price must be >= 0 but I don\'t really want to impose a max value.

Here\'s what I have so far...I\'m not sure what the

10条回答
  •  日久生厌
    2021-01-31 01:13

    I would put decimal.MaxValue.ToString() since this is the effective ceiling for the decmial type it is equivalent to not having an upper bound.

提交回复
热议问题