diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicRangeAttributeAdapter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicRangeAttributeAdapter.cs index f084c559ad..d3344c20f2 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicRangeAttributeAdapter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicRangeAttributeAdapter.cs @@ -17,8 +17,8 @@ namespace Volo.Abp.AspNetCore.Mvc.DataAnnotations IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer) { - _min = Attribute.Minimum.ToString()?.ToString(CultureInfo.InvariantCulture); - _max = Attribute.Maximum.ToString()?.ToString(CultureInfo.InvariantCulture); + _min = Convert.ToString(Attribute.Minimum,CultureInfo.InvariantCulture); + _max = Convert.ToString(Attribute.Maximum,CultureInfo.InvariantCulture); } public override void AddValidation(ClientModelValidationContext context) @@ -26,9 +26,9 @@ namespace Volo.Abp.AspNetCore.Mvc.DataAnnotations Check.NotNull(context, nameof(context)); MergeAttribute(context.Attributes, "data-val", "true"); - MergeAttribute(context.Attributes, "data-val-length", GetErrorMessage(context)); - MergeAttribute(context.Attributes, "data-val-length-min", _min); - MergeAttribute(context.Attributes, "data-val-length-max", _max); + MergeAttribute(context.Attributes, "data-val-range", GetErrorMessage(context)); + MergeAttribute(context.Attributes, "data-val-range-min", _min); + MergeAttribute(context.Attributes, "data-val-range-max", _max); } public override string GetErrorMessage(ModelValidationContextBase validationContext) diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Validation/DynamicRangeAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Validation/DynamicRangeAttribute.cs index 2836987302..49c91f593e 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Validation/DynamicRangeAttribute.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Validation/DynamicRangeAttribute.cs @@ -27,9 +27,9 @@ namespace Volo.Abp.Validation } /// A type to get the values of the properties + /// The type of the range parameters. Must implement IComparable. /// The name of the public static property for the /// The name of the public static property for the - /// The type of the range parameters. Must implement IComparable. public DynamicRangeAttribute( [NotNull] Type sourceType, [NotNull] Type operandType,