Hi, how can I apply Required Attribute like validation to the following without knowing how many elements will be in each collection:
public class MyViewPageViewModel
{
[Required]
public List<int> IntCollection { get; set; }
[Required]
public Dictionary<int, string> IntAndStringAllValueCollection { get; set; }
[Required("Value")]
public Dictionary<int, string> IntAndStringValueValidationCollection { get; set; }
[Required("Name","HairColor")]
public List<Person> PersonNameValidationCollection { get; set; }
}
For IntCollection I want every element to be required. For IntAndStringAllValueCollection I want every Key and every Value to be required. For IntAndStringValueValidationCollection I do not want the Key to be required but I want the Value to be required.