Revert "Changed min/max parameter order in StringLengthAttributeAdapter"

This reverts commit d19765802b.
This commit is contained in:
Crystal Qian 2016-06-22 15:34:53 -07:00
parent d19765802b
commit dad6374258
3 changed files with 4 additions and 4 deletions

View File

@ -54,8 +54,8 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
return GetErrorMessage(
validationContext.ModelMetadata,
validationContext.ModelMetadata.GetDisplayName(),
Attribute.MaximumLength,
Attribute.MinimumLength);
Attribute.MinimumLength,
Attribute.MaximumLength);
}
}
}

View File

@ -417,7 +417,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
{
new StringLengthAttribute(length) { ErrorMessage = LocalizationKey, MinimumLength = 1},
string.Empty,
new object[] { nameof(SampleModel), length, 1 }
new object[] { nameof(SampleModel), 1, length }
},
{
new RangeAttribute(0, length) { ErrorMessage = LocalizationKey },

View File

@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
var expectedMessage = "Property must not be longer than '8' characters.";
var stringLocalizer = new Mock<IStringLocalizer>();
var expectedProperties = new object[] { "Length", 8, 0 };
var expectedProperties = new object[] { "Length", 0, 8 };
stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties])
.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));