2 writes to ErrorMessage
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
CompareAttributeAdapter.cs (1)
63ErrorMessage = attribute.ErrorMessage;
Shared.Tests (1)
Data.Validation\LengthAttributeTests.cs (1)
381[Length(5, ErrorMessage = "My custom message for '{0}'.")]
29 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.ViewFeatures (2)
RemoteAttributeBase.cs (2)
196!string.IsNullOrEmpty(ErrorMessage) && 200return _stringLocalizer[ErrorMessage, displayName];
Microsoft.Extensions.Compliance.Redaction (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
Microsoft.Extensions.Telemetry (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
Microsoft.Extensions.Validation.Localization (10)
DefaultValidationLocalizer.cs (1)
48lookupKey = context.Attribute.ErrorMessage;
ValidationLocalizationOptions.cs (9)
67/// every attribute and takes precedence over <see cref="ValidationAttribute.ErrorMessage"/>. 69/// <see cref="ValidationAttribute.ErrorMessage"/> directly as the lookup key. 74/// <see cref="ValidationAttribute.ErrorMessage"/> set are localized (using the 75/// <see cref="ValidationAttribute.ErrorMessage"/> value as the key); attributes without 76/// an explicit <see cref="ValidationAttribute.ErrorMessage"/> are not localized at all. 83/// <see cref="ValidationAttribute.ErrorMessage"/> (convention-based key selection).</item> 84/// <item>Transform an existing <see cref="ValidationAttribute.ErrorMessage"/> into a 87/// <see cref="ValidationAttribute.ErrorMessage"/> from the context.</item> 89/// behavior of using <see cref="ValidationAttribute.ErrorMessage"/> as the key.</item>
Shared (1)
Data.Validation\LengthAttribute.cs (1)
173if (!string.IsNullOrEmpty(ErrorMessage) || !string.IsNullOrEmpty(ErrorMessageResourceName))
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;