I have a property in a Model class something like:
/// <summary>
/// A list of line items in the receipt
/// </summary>
public ICollection<ReceiptItem> Items { get; set; }
Is there any way I can mark up this property to validate that the collection must have 1 or more members? I am trying to avoid a manual validation function call outside of ModelState.IsValid
I ended up solving the problem by using a custom DataAnnotation — did not think to see if this could be done first!
Here is my code if it helps anyone else!