Business rule validation of hierarchical list of objects ASP.NET MVC
- by SergeanT
I have a list of objects that are organized in a tree using a Depth property:
public class Quota
{
[Range(0, int.MaxValue, ErrorMessage = "Please enter an amount above zero.")]
public int Amount { get; set; }
public int Depth { get; set; }
[Required]
[RegularExpression("^[a-zA-Z]+$")]
public string Origin { get; set; }
…