問題:
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