116 writes to ErrorMessage
BasicWebSite (8)
Controllers\BindPropertiesWithValidationController.cs (2)
13[Required(ErrorMessage = "User name is required.")] 19[Compare(nameof(Password), ErrorMessage = "Password and confirm password do not match.")]
Models\RemoteAttributeUser.cs (6)
14[Required(ErrorMessage = "UserId1 is required")] 19[Required(ErrorMessage = "UserId2 is required")] 23[Required(ErrorMessage = "UserId3 is required")] 28ErrorMessage = "/Area1/RemoteAttribute_Verify/IsIdAvailable rejects you.")] 31[Required(ErrorMessage = "UserId4 is required")] 39[Required(ErrorMessage = "UserId5 is required")]
Identity.ExternalClaims (10)
Pages\Account\LoginWith2fa.cshtml.cs (1)
38[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Pages\Account\Manage\ChangePassword.cshtml.cs (2)
47[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 54[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Pages\Account\Manage\EnableAuthenticator.cshtml.cs (1)
49[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Pages\Account\Manage\SetPassword.cshtml.cs (2)
38[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 45[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Pages\Account\Register.cshtml.cs (2)
50[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 57[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Pages\Account\ResetPassword.cshtml.cs (2)
35[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 41[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
IdentitySample.DefaultUI (4)
Areas\Identity\Pages\Account\Manage\Index.cshtml.cs (1)
45[Range(0, 199, ErrorMessage = "Age must be between 0 and 199")]
Areas\Identity\Pages\Account\Register.cshtml.cs (3)
49[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 56[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] 65[Range(0, 199, ErrorMessage = "Age must be between 0 and 199 years")]
IdentitySample.Mvc (8)
Models\AccountViewModels\RegisterViewModel.cs (2)
16[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 23[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Models\AccountViewModels\ResetPasswordViewModel.cs (2)
15[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 21[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Models\ManageViewModels\ChangePasswordViewModel.cs (2)
16[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 23[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Models\ManageViewModels\SetPasswordViewModel.cs (2)
11[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] 18[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Microsoft.AspNetCore.Components.Forms.Tests (2)
EditContextDataAnnotationsExtensionsTest.cs (2)
185[Required(ErrorMessage = "RequiredString:required")] public string RequiredString { get; set; } 187[Range(1, 100, ErrorMessage = "IntFrom1To100:range")] public int IntFrom1To100 { get; set; }
Microsoft.AspNetCore.Identity.UI (20)
Areas\Identity\Pages\V4\Account\LoginWith2fa.cshtml.cs (1)
51[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Areas\Identity\Pages\V4\Account\Manage\ChangePassword.cshtml.cs (2)
52[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 63[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (1)
66[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Areas\Identity\Pages\V4\Account\Manage\SetPassword.cshtml.cs (2)
42[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 53[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (2)
65[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 76[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Areas\Identity\Pages\V4\Account\ResetPassword.cshtml.cs (2)
47[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 57[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Areas\Identity\Pages\V5\Account\LoginWith2fa.cshtml.cs (1)
51[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Areas\Identity\Pages\V5\Account\Manage\ChangePassword.cshtml.cs (2)
52[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 63[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (1)
66[StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
Areas\Identity\Pages\V5\Account\Manage\SetPassword.cshtml.cs (2)
42[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 53[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (2)
65[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 76[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Areas\Identity\Pages\V5\Account\ResetPassword.cshtml.cs (2)
47[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 57[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Microsoft.AspNetCore.Mvc.Core.Test (5)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (2)
1191[Required(ErrorMessage = "Sample message")] 1283[Required(ErrorMessage = "This message comes from the [Required] attribute.")]
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
1366[Required(ErrorMessage = "Sample message")] 1458[Required(ErrorMessage = "This message comes from the [Required] attribute.")]
ModelBinding\ParameterBinderTest.cs (1)
880ErrorMessage = "Always Invalid";
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
CompareAttributeAdapter.cs (1)
63ErrorMessage = attribute.ErrorMessage;
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (33)
CompareAttributeAdapterTest.cs (2)
59attribute.ErrorMessage = "CompareAttributeErrorMessage"; 137ErrorMessage = "Hello '{0}', goodbye '{1}'."
DataAnnotationsClientModelValidatorProviderTest.cs (1)
151[Required(ErrorMessage = "Custom Required Message")]
DataAnnotationsMetadataProviderTest.cs (1)
1914[Required(ErrorMessage = "Test")]
DataAnnotationsModelValidatorProviderTest.cs (1)
207[Required(ErrorMessage = "Custom Required Message")]
DataAnnotationsModelValidatorTest.cs (12)
369attribute.ErrorMessage = "{0} should have no more than {1} characters."; 452new RegularExpressionAttribute(regex) { ErrorMessage = LocalizationKey }, 457new MaxLengthAttribute(length) { ErrorMessage = LocalizationKey }, 461new MaxLengthAttribute(length) { ErrorMessage = LocalizationKey }, 466new CompareAttribute(pattern) { ErrorMessage = LocalizationKey }, 470new MinLengthAttribute(length) { ErrorMessage = LocalizationKey }, 475new CreditCardAttribute() { ErrorMessage = LocalizationKey }, 480new StringLengthAttribute(length) { ErrorMessage = LocalizationKey, MinimumLength = 1}, 485new RangeAttribute(0, length) { ErrorMessage = LocalizationKey }, 490new EmailAddressAttribute() { ErrorMessage = LocalizationKey }, 495new PhoneAttribute() { ErrorMessage = LocalizationKey }, 500new UrlAttribute() { ErrorMessage = LocalizationKey },
FileExtensionsAttributeAdapterTest.cs (4)
26attribute.ErrorMessage = "{0} expects only the following extensions: {1}"; 77attribute.ErrorMessage = "{0} expects only the following extensions: {1}"; 107attribute.ErrorMessage = "{0} expects only the following extensions: {1}"; 141attribute.ErrorMessage = "{0} expects only the following extensions: {1}";
MaxLengthAttributeAdapterTest.cs (3)
24attribute.ErrorMessage = "Property must be max '{1}' characters long."; 88var attribute = new MaxLengthAttribute(5) { ErrorMessage = message }; 115attribute.ErrorMessage = errorKey;
MinLengthAttributeAdapterTest.cs (3)
24attribute.ErrorMessage = "Property must be at least '{1}' characters long."; 85var attribute = new MinLengthAttribute(2) { ErrorMessage = "Array must have at least {1} items." }; 113var attribute = new MinLengthAttribute(2) { ErrorMessage = "Array must have at least {1} items." };
RangeAttributeAdapterTest.cs (3)
23attribute.ErrorMessage = "The field Length must be between {1} and {2}."; 53attribute.ErrorMessage = "The field Length must be between {1} and {2}."; 89attribute.ErrorMessage = "The field Length must be between {1} and {2}.";
RequiredAttributeAdapterTest.cs (1)
28attribute.ErrorMessage = message;
StringLengthAttributeAdapterTest.cs (1)
24attribute.ErrorMessage = "Property must not be longer than '{1}' characters and not shorter than '{2}' characters.";
ValidationAttributeAdapterProviderTest.cs (1)
95ErrorMessage = "Not valid.";
Microsoft.AspNetCore.Mvc.IntegrationTests (10)
DictionaryModelBinderIntegrationTest.cs (1)
465[Range(minimum: 0, maximum: 15, ErrorMessage = "You're out of range.")]
NullableReferenceTypeIntegrationTest.cs (1)
102[Required(ErrorMessage = "Test")]
TryValidateModelIntegrationTest.cs (2)
176[Required(ErrorMessage = "Property")] 184ErrorMessage = "Model";
ValidationIntegrationTests.cs (3)
675[StringLength(5, ErrorMessage = "Too Long.")] 763[StringLength(5, ErrorMessage = "Too Long.")] 1093[StringLength(5, ErrorMessage = "Too Long.")]
ValidationWithRecordIntegrationTests.cs (3)
560private record Order6([StringLength(5, ErrorMessage = "Too Long.")] string Name); 641private record Person7([StringLength(5, ErrorMessage = "Too Long.")] string Name); 953private record Order10([StringLength(5, ErrorMessage = "Too Long.")] string Name);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (8)
RemoteAttributeBaseTest.cs (8)
67ErrorMessage = "Error about '{0}' from override.", 150ErrorMessage = "Error about '{0}' from override.", 185ErrorMessage = "Error about '{0}' from override.", 220ErrorMessage = "Error about '{0}' from override.", 261ErrorMessage = "Error about '{0}' from override.", 357ErrorMessage = "Error about '{0}' from override.", 398ErrorMessage = "Error about '{0}' from override.", 443ErrorMessage = "Error"
RazorPagesWebSite (7)
Pages\CustomModelTypeModel.cshtml.cs (2)
30[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] 37[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
Pages\Validation\PageWithCompareValidation.cs (3)
13[Required(ErrorMessage = "User name is required.")] 17[Required(ErrorMessage = "Password is required.")] 21[Compare(nameof(Password), ErrorMessage = "Password and confirm password do not match.")]
Pages\Validation\PageWithValidation.cs (2)
13[Required(ErrorMessage = "Name is required.")] 17[Range(18, 60, ErrorMessage = "18 ≤ Age ≤ 60")]
34 references to ErrorMessage
Microsoft.AspNetCore.Mvc.DataAnnotations (5)
CompareAttributeAdapter.cs (2)
59if (!string.IsNullOrEmpty(attribute.ErrorMessage) || 63ErrorMessage = attribute.ErrorMessage;
DataAnnotationsModelValidator.cs (1)
88!string.IsNullOrEmpty(Attribute.ErrorMessage) &&
ValidationAttributeAdapterOfTAttribute.cs (2)
70!string.IsNullOrEmpty(Attribute.ErrorMessage) && 74return _stringLocalizer[Attribute.ErrorMessage, arguments];
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (20)
CompareAttributeAdapterTest.cs (2)
66stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 67.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
DataAnnotationsClientModelValidatorProviderTest.cs (1)
112Assert.Equal("Custom Required Message", adapter.Attribute.ErrorMessage);
DataAnnotationsMetadataProviderTest.cs (1)
1190Assert.Equal("Test", ((RequiredAttribute)attribute).ErrorMessage);
DataAnnotationsModelValidatorTest.cs (2)
371var localizedString = new LocalizedString(attribute.ErrorMessage, "Longueur est invalide : 4"); 373stringLocalizer.Setup(s => s[attribute.ErrorMessage, It.IsAny<object[]>()]).Returns(localizedString);
FileExtensionsAttributeAdapterTest.cs (4)
30var expectedErrorMessage = string.Format(CultureInfo.CurrentCulture, attribute.ErrorMessage, nameof(Profile.PhotoFileName), formattedExtensions); 81var expectedErrorMessage = string.Format(CultureInfo.CurrentCulture, attribute.ErrorMessage, nameof(Profile.PhotoFileName), formattedExtensions); 115.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 116.Returns(new LocalizedString(attribute.ErrorMessage, expectedErrorMessage));
MaxLengthAttributeAdapterTest.cs (2)
30stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 31.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
MinLengthAttributeAdapterTest.cs (2)
30stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 31.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
RangeAttributeAdapterTest.cs (2)
60.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 61.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
RequiredAttributeAdapterTest.cs (2)
31stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 32.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
StringLengthAttributeAdapterTest.cs (2)
31stringLocalizer.Setup(s => s[attribute.ErrorMessage, expectedProperties]) 32.Returns(new LocalizedString(attribute.ErrorMessage, expectedMessage));
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
RemoteAttributeBase.cs (2)
196!string.IsNullOrEmpty(ErrorMessage) && 200return _stringLocalizer[ErrorMessage, displayName];
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
RemoteAttributeBaseTest.cs (1)
39Assert.Null(attribute.ErrorMessage);
System.ComponentModel.Annotations (6)
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (6)
18/// a localized error message, but they cannot be set if <see cref="ErrorMessage" /> is also used to provide a 84/// This message will be used if the user has not set <see cref="ErrorMessage"/> 116/// Gets the localized error message string, coming either from <see cref="ErrorMessage" />, or from evaluating the 177/// that will provide a localized error message. Use <see cref="ErrorMessage" /> for non-localized error messages. 197/// Use <see cref="ErrorMessage" /> instead of this pair if error messages are not localized. 225string? localErrorMessage = ErrorMessage;