MVC ICollection<IFormFile> ValidationState always set to Skipped
问题 As part of an ASP.NET Core MVC 1.0 project, I have a ViewModel with an ICollection<> property. I need to validate that this collection contains one or more items. My custom validation attribute doesn't get executed. In my instance it holds multiple file attachments from a multipart/form-data form. I have decorated the property in the ViewModel with a custom validation attribute: [RequiredCollection] public ICollection<IFormFile> Attachments { get; set; } Below is the custom attribute class.