18 lines
719 B
C#
18 lines
719 B
C#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
namespace Microsoft.AspNet.Mvc.ModelBinding
|
|
{
|
|
public class ModelClientValidationMinLengthRule : ModelClientValidationRule
|
|
{
|
|
private const string MinLengthValidationType = "minlength";
|
|
private const string MinLengthValidationParameter = "min";
|
|
|
|
public ModelClientValidationMinLengthRule([NotNull] string errorMessage, int minimumLength)
|
|
: base(MinLengthValidationType, errorMessage)
|
|
{
|
|
ValidationParameters[MinLengthValidationParameter] = minimumLength;
|
|
}
|
|
}
|
|
}
|