Example #1
0
 public static PropertyMetadataBuilder <T, TProperty?> InRange <T, TProperty>(this PropertyMetadataBuilder <T, TProperty?> builder, TProperty?minimum, TProperty?maximum, Func <string> errorMessageAccessor = null) where TProperty : struct, IComparable
 {
     return(builder.AddOrReplaceAttribute(new RangeAttribute(minimum, maximum, errorMessageAccessor)));
 }
Example #2
0
 public static PropertyMetadataBuilder <T, string> UrlDataType <T>(this PropertyMetadataBuilder <T, string> builder, Func <string> errorMessageAccessor = null)
 {
     return(builder.AddOrReplaceAttribute(new UrlAttribute(errorMessageAccessor)));
 }
 public static PropertyMetadataBuilder <T, TProperty> InRange <T, TProperty>(this PropertyMetadataBuilder <T, TProperty> builder, TProperty minimum, TProperty maximum, Func <TProperty, string> errorMessageAccessor) where TProperty : IComparable
 {
     return(builder.AddOrReplaceAttribute(new RangeAttribute(minimum, maximum, DXValidationAttribute.ErrorMessageAccessor(errorMessageAccessor))));
 }