ModelState validation checking multiple boolean property
问题 I have view model that have multiple boolean properties, in my controller i have checking ModelState.IsValid before proceeding to service layer. Now I want to make that ModelState.IsValid return false if none of boolean property set to true, is there a way to make it happen? Here is my sample class public class Role { public int Id {get; set;} [Required(ErrorMessage = "Please enter a role name")] public string Name {get; set;} public bool IsCreator {get; set;} public bool IsEditor {get; set;}