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 correct way to do this is.

[Range(typeof(decimal), "0", "??"] public decimal Price { get; set; }

10 Answers
10

Leave a Reply

Your email address will not be published. Required fields are marked *