参数化数据注释

时间:2017-10-11 10:03:43

标签: asp.net-mvc data-annotations

有没有办法在StringLength数据注释中参数化最小长度?

    [Required(ErrorMessageResourceType = typeof(Language),ErrorMessageResourceName = "Delivery_ZIPRequired")]
    [StringLength(5, MinimumLength = 5, ErrorMessageResourceType = typeof(Language), ErrorMessageResourceName = "Address_ZipInvalidLength")]
    public string Zip { get; set; }

0 个答案:

没有答案