9 instantiations of ValidationResult
System.ComponentModel.DataAnnotations (6)
DataAnnotations\CompareAttribute.cs (2)
41
return new
ValidationResult
(String.Format(CultureInfo.CurrentCulture, DataAnnotationsResources.CompareAttribute_UnknownProperty, OtherProperty));
49
return new
ValidationResult
(FormatErrorMessage(validationContext.DisplayName));
DataAnnotations\CustomValidationAttribute.cs (1)
138
return new
ValidationResult
(String.Format(CultureInfo.CurrentCulture, Resources.DataAnnotationsResources.CustomValidationAttribute_Type_Conversion_Failed,
DataAnnotations\ValidationAttribute.cs (2)
382
result = new
ValidationResult
(this.FormatErrorMessage(validationContext.DisplayName), memberNames);
423
result = new
ValidationResult
(errorMessage, result.MemberNames);
DataAnnotations\ValidationException.cs (1)
35
this._validationResult = new
ValidationResult
(this.Message);
System.Web (3)
Security\MembershipPasswordAttribute.cs (3)
182
return new
ValidationResult
(FormatErrorMessage(errorMessage, name, MinRequiredPasswordLength), memberNames);
188
return new
ValidationResult
(FormatErrorMessage(errorMessage, name, MinRequiredNonAlphanumericCharacters), memberNames);
205
return new
ValidationResult
(FormatErrorMessage(errorMessage, name, additionalArgument: String.Empty), memberNames);
71 references to ValidationResult
System.ComponentModel.DataAnnotations (59)
DataAnnotations\CompareAttribute.cs (1)
38
protected override
ValidationResult
IsValid(object value, ValidationContext validationContext) {
DataAnnotations\CustomValidationAttribute.cs (13)
9
/// public static <see cref="
ValidationResult
"/> Method(object value) { ... }
12
/// public static <see cref="
ValidationResult
"/> Method(object value, <see cref="ValidationContext"/> context) { ... }
27
/// The named <see cref="Method"/> must be public, static, return <see cref="
ValidationResult
"/> and take at
37
/// If the method returns <see cref="
ValidationResult
"/>.<see cref="
ValidationResult
.Success"/>, that indicates the given value is acceptable and validation passed.
38
/// Returning an instance of <see cref="
ValidationResult
"/> indicates that the value is not acceptable
42
/// If the method returns a <see cref="
ValidationResult
"/> with a <c>null</c> <see cref="
ValidationResult
.ErrorMessage"/>
70
/// <see cref="IsValid(object, ValidationContext)"/>> to return a <see cref="
ValidationResult
"/>
127
protected override
ValidationResult
IsValid(object value, ValidationContext validationContext) {
152
ValidationResult
result = (
ValidationResult
)methodInfo.Invoke(null, methodParams);
230
if (methodInfo.ReturnType != typeof(
ValidationResult
)) {
DataAnnotations\IValidatableObject.cs (1)
8
IEnumerable<
ValidationResult
> Validate(ValidationContext validationContext);
DataAnnotations\ValidationAttribute.cs (16)
344
/// When validation is valid, <see cref="
ValidationResult
.Success"/>.
346
/// When validation is invalid, an instance of <see cref="
ValidationResult
"/>.
371
protected virtual
ValidationResult
IsValid(object value, ValidationContext validationContext) {
377
ValidationResult
result =
ValidationResult
.Success;
393
/// If this method returns <see cref="
ValidationResult
.Success"/>, then validation was successful, otherwise
394
/// an instance of <see cref="
ValidationResult
"/> will be returned with a guaranteed non-null
395
/// <see cref="
ValidationResult
.ErrorMessage"/>.
401
/// When validation is valid, <see cref="
ValidationResult
.Success"/>.
403
/// When validation is invalid, an instance of <see cref="
ValidationResult
"/>.
411
public
ValidationResult
GetValidationResult(object value, ValidationContext validationContext) {
416
ValidationResult
result = this.IsValid(value, validationContext);
460
/// If that method doesn't return <see cref="
ValidationResult
.Success"/>, this base method will throw
461
/// a <see cref="ValidationException"/> containing the <see cref="
ValidationResult
"/> describing the problem.
466
/// doesn't return <see cref="
ValidationResult
.Success"/>.
477
ValidationResult
result = this.GetValidationResult(value, validationContext);
DataAnnotations\ValidationException.cs (3)
19
private
ValidationResult
_validationResult;
32
public
ValidationResult
ValidationResult {
52
public ValidationException(
ValidationResult
validationResult, ValidationAttribute validatingAttribute, object value)
DataAnnotations\ValidationResult.cs (6)
8
/// Use the static <see cref="
ValidationResult
.Success"/> to represent successful validation.
23
/// Gets a <see cref="
ValidationResult
"/> that indicates Success.
26
/// The <c>null</c> value is used to indicate success. Consumers of <see cref="
ValidationResult
"/>s
27
/// should compare the values to <see cref="
ValidationResult
.Success"/> rather than checking for null.
30
public static readonly
ValidationResult
Success;
65
protected ValidationResult(
ValidationResult
validationResult) {
DataAnnotations\Validator.cs (19)
22
/// this method will add a <see cref="
ValidationResult
"/> to it for each validation failure.
35
/// <param name="validationResults">Optional collection to receive <see cref="
ValidationResult
"/>s for the failures.</param>
40
public static bool TryValidateProperty(object value, ValidationContext validationContext, ICollection<
ValidationResult
> validationResults) {
77
/// <param name="validationResults">Optional collection to receive <see cref="
ValidationResult
"/>s for the failures.</param>
82
public static bool TryValidateObject(object instance, ValidationContext validationContext, ICollection<
ValidationResult
> validationResults) {
106
/// <param name="validationResults">Optional collection to receive <see cref="
ValidationResult
"/>s for the failures.</param>
113
public static bool TryValidateObject(object instance, ValidationContext validationContext, ICollection<
ValidationResult
> validationResults, bool validateAllProperties) {
141
/// <paramref name="validationResults"/> is non-null, this method will add a <see cref="
ValidationResult
"/>
156
/// <param name="validationResults">Optional collection to receive <see cref="
ValidationResult
"/>s for the failures.</param>
159
public static bool TryValidateValue(object value, ValidationContext validationContext, ICollection<
ValidationResult
> validationResults, IEnumerable<ValidationAttribute> validationAttributes) {
367
IEnumerable<
ValidationResult
> results = validatable.Validate(validationContext);
369
foreach (
ValidationResult
result in results.Where(r => r !=
ValidationResult
.Success)) {
404
ValidationResult
validationResult = reqAttr.GetValidationResult(property.Value, property.Key);
405
if (validationResult !=
ValidationResult
.Success) {
519
ValidationResult
validationResult = attribute.GetValidationResult(value, validationContext);
520
if (validationResult !=
ValidationResult
.Success) {
534
internal ValidationError(ValidationAttribute validationAttribute, object value,
ValidationResult
validationResult) {
544
internal
ValidationResult
ValidationResult { get; set; }
System.Web (12)
ModelBinding\DataAnnotationsModelValidator.cs (4)
84
ValidationResult
result = Attribute.GetValidationResult(Metadata.Model, context);
85
if (result !=
ValidationResult
.Success)
101
private string GetValidationErrorMessage(
ValidationResult
result) {
115
private static string GetValidationErrorMemberName(
ValidationResult
result, string memberName)
ModelBinding\ValidatableObjectAdapter.cs (3)
38
private IEnumerable<ModelValidationResult> ConvertResults(IEnumerable<
ValidationResult
> results) {
39
foreach (
ValidationResult
result in results) {
40
if (result !=
ValidationResult
.Success) {
Security\MembershipPasswordAttribute.cs (5)
164
/// When validation is valid, <see cref="
ValidationResult
.Success"/>.
166
/// When validation is invalid, an instance of <see cref="
ValidationResult
"/>.
169
protected override
ValidationResult
IsValid(object value, ValidationContext validationContext) {
177
return
ValidationResult
.Success;
209
return
ValidationResult
.Success;