How would one go about validating a nested List of Objects in an MVC Model?
I have an "Item" object which has an attached List of Revenue Entries:
public class ItemModel
{
public int ItemID { get; set; }
public virtual List<RevenueEntryModel> Revenues { get; set;}
}
This list can be edited on the page dynamically, and each item is validated individually using it's own model - "RevenueEntryModel". However, I want to be able to restrict users from entering Items without any Revenues.
Is it possible to validate whether this Revenues list is empty using Data Annotations? I'm already using Foolproof but I'm pretty sure it doesn't include this functionality.