我在下面有这个。似乎正则表达式就足够了,但不确定吗?
[Required(ErrorMessage = "Routing is required")]
[StringLength(9, MinimumLength = 9, ErrorMessage = "Your routing number must be 9 digits")]
[RegularExpression(@"^\d{9}$", ErrorMessage = "Routing number must be 9 digits. 0-9")]
public string Routing { get; set; }