diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs index 8d5a7abfb1..14ff42e320 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs @@ -20,13 +20,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Validation { validationAttribute.ErrorMessage = "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}."; + return; } } - else - { - validationAttribute.ErrorMessage = - ValidationAttributeErrorMessageStringProperty.GetValue(validationAttribute) as string; - } + + validationAttribute.ErrorMessage = + ValidationAttributeErrorMessageStringProperty.GetValue(validationAttribute) as string; } } }