Browse Source

Update DynamicMaxLengthAttributeAdapter.cs

pull/4524/head
Ahmet Çotur 6 years ago
parent
commit
40863bc408
  1. 7
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs

7
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs

@ -33,12 +33,13 @@ 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", "true");
MergeAttribute(context.Attributes, "data-val-maxlength", GetErrorMessage(context));
MergeAttribute(context.Attributes, "data-val-maxlength-max", _max);
if (Attribute.Length != int.MaxValue)
{
MergeAttribute(context.Attributes, "data-val-length-max", _max);
MergeAttribute(context.Attributes, "data-val-maxlength-max", _max);
}
}
}

Loading…
Cancel
Save