更新
This commit is contained in:
@@ -14,6 +14,6 @@ public sealed class MaximumAttribute : ValidationAttribute
|
||||
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
return double.TryParse(value.ToString(), out var d) && d <= MaxValue ? ValidationResult.Success : new ValidationResult("输入值超出范围");
|
||||
return double.TryParse(value.ToString(), out var d) && d <= MaxValue ? ValidationResult.Success : new ValidationResult($"输入值超出范围,最大值应为{MaxValue}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user