问题:
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.我想指定价格的十进制字段必须 >= 0 但我真的不想强加最大值。
Here's what I have so far...I'm not sure what the correct way to do this is.这是我到目前为止所拥有的......我不确定这样做的正确方法是什么。
[Range(typeof(decimal), "0", "??"] public decimal Price { get; set; }
解决方案:
参考一: https://en.stackoom.com/question/E2HE参考二: https://stackoom.com/question/E2HE