Browse Source

Update DynamicMaxLengthAttributeAdapter.cs

pull/4524/head
Ahmet Çotur 6 years ago
parent
commit
2d4f89bddf
  1. 10
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs

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

@ -9,9 +9,9 @@ namespace Volo.Abp.AspNetCore.Mvc.DataAnnotations
public class DynamicMaxLengthAttributeAdapter : AttributeAdapterBase<DynamicMaxLengthAttribute>
{
private readonly string _max;
public DynamicMaxLengthAttributeAdapter(
DynamicMaxLengthAttribute attribute,
DynamicMaxLengthAttribute attribute,
IStringLocalizer stringLocalizer)
: base(attribute, stringLocalizer)
{
@ -33,9 +33,9 @@ namespace Volo.Abp.AspNetCore.Mvc.DataAnnotations
{
Check.NotNull(context, nameof(context));
MergeAttribute(context.Attributes, "data-val", "true");
MergeAttribute(context.Attributes, "data-val-maxlength", GetErrorMessage(context));
MergeAttribute(context.Attributes, "data-val-maxlength-max", _max);
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)
{

Loading…
Cancel
Save