I would like to specify a non-negative constraint on a column. Not sure how should I go about it. My search on the google didn't help any.
public class Price
{
[Key, Column(Order = 0)]
public int ItemID { get; set; }
[Key, Column(Order = 1)]
public int ItemQty { get; set; }
[DataType(DataType.Currency), Column(TypeName = "MONEY")]
public decimal ItemPrice { get; set; }
}
Here I would like ItemQty to be a positive integer. I did think of using Range, but I'm not sure it is the right way...
I went with Range() in the end. Still open to suggestions though.