I have a viewmodel that partially looks like this...
[Required]
public int Year { get; set; }
[Required]
[Range(1, 5000000)]
public int ModelID { get; set; }
[Required]
public int ZipCode{ get; set;}
I want to add a custom validator attribute that checks a database to make sure the Zip is valid. Something like...
[Required]
[IsValidZipcode]
public int ZipCode{ get; set;}
I haven't been able to find a tutorial on the net - I don't think I know what to search for because this seems like it would be common.
How should I go about this?