27 instantiations of ValidationContext
Microsoft.AspNetCore.Components.Forms (2)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.Extensions.Http.Resilience.Tests (1)
Microsoft.Extensions.Options.DataAnnotations (1)
Shared.Tests (20)
System.ComponentModel.Annotations (1)
169 references to ValidationContext
BasketService (1)
FormatterWebSite (2)
Microsoft.AspNetCore.Components.Forms (3)
Microsoft.AspNetCore.Mvc.Core.Test (8)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (10)
Microsoft.AspNetCore.Mvc.IntegrationTests (15)
Microsoft.Extensions.Compliance.Redaction (5)
Microsoft.Extensions.Diagnostics.Probes (5)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Microsoft.Extensions.Http.Resilience (5)
Microsoft.Extensions.Http.Resilience.Tests (1)
Microsoft.Extensions.Telemetry (5)
MyFrontend (1)
OrderProcessor (1)
Shared (5)
Shared.Tests (14)
System.ComponentModel.Annotations (80)
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (15)
13/// <para>Override <see cref="IsValid(object, ValidationContext)" /> to implement validation logic.</para>
136/// <see cref="ValidationContext" /> to perform validation.
298private protected ValidationResult CreateFailedValidationResult(ValidationContext validationContext)
338/// Instead, implement <see cref="IsValid(object, ValidationContext)" />.
375/// A <see cref="ValidationContext" /> instance that provides
386/// is thrown when <see cref="IsValid(object, ValidationContext)" />
389protected virtual ValidationResult? IsValid(object? value, ValidationContext validationContext)
415/// A <see cref="ValidationContext" /> instance that provides
427/// is thrown when <see cref="IsValid(object, ValidationContext)" />
430public ValidationResult? GetValidationResult(object? value, ValidationContext validationContext)
452/// The overloaded <see cref="Validate(object, ValidationContext)" /> is the recommended entry point as it
480/// This method invokes the <see cref="IsValid(object, ValidationContext)" /> method
489/// is thrown if <see cref="IsValid(object, ValidationContext)" />
494/// is thrown when <see cref="IsValid(object, ValidationContext)" />
497public void Validate(object? value, ValidationContext validationContext)
System\ComponentModel\DataAnnotations\Validator.cs (38)
45/// When the <see cref="ValidationContext.MemberName" /> of <paramref name="validationContext" /> is not a valid
49public static bool TryValidateProperty(object? value, ValidationContext validationContext,
92/// <see cref="ValidationContext.ObjectInstance" />on <paramref name="validationContext" />.
94[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
96object instance, ValidationContext validationContext, ICollection<ValidationResult>? validationResults) =>
130/// <see cref="ValidationContext.ObjectInstance" />on <paramref name="validationContext" />.
132[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
133public static bool TryValidateObject(object instance, ValidationContext validationContext,
185public static bool TryValidateValue(object? value, ValidationContext validationContext,
216public static void ValidateProperty(object? value, ValidationContext validationContext)
246/// <see cref="ValidationContext.ObjectInstance" /> on <paramref name="validationContext" />.
249[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
250public static void ValidateObject(object instance, ValidationContext validationContext)
272/// <see cref="ValidationContext.ObjectInstance" /> on <paramref name="validationContext" />.
275[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
276public static void ValidateObject(object instance, ValidationContext validationContext,
311public static void ValidateValue(object? value, ValidationContext validationContext,
325/// Creates a new <see cref="ValidationContext" /> to use to validate the type or a member of
331/// and <see cref="ValidationContext.Items" />.
333/// <returns>A new <see cref="ValidationContext" /> for the <paramref name="instance" /> provided.</returns>
335[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
336private static ValidationContext CreateValidationContext(object instance, ValidationContext validationContext)
341var context = new ValidationContext(instance, validationContext, validationContext.Items);
400/// <see cref="ValidationContext.ObjectInstance" /> on <paramref name="validationContext" />.
402[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
404ValidationContext validationContext, bool validateAllProperties, bool breakOnFirstError)
460[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
462ValidationContext validationContext, bool validateAllProperties, bool breakOnFirstError)
515[RequiresUnreferencedCode(ValidationContext.InstanceTypeNotStaticallyDiscovered)]
516private static List<KeyValuePair<ValidationContext, object?>> GetPropertyValues(object instance,
517ValidationContext validationContext)
520var items = new List<KeyValuePair<ValidationContext, object?>>(properties.Count);
523var context = CreateValidationContext(instance, validationContext);
529items.Add(new KeyValuePair<ValidationContext, object?>(context, property.GetValue(instance)));
554ValidationContext validationContext, IEnumerable<ValidationAttribute> attributes, bool breakOnFirstError)
599/// <see cref="ValidationContext" />.
610private static bool TryValidate(object? value, ValidationContext validationContext, ValidationAttribute attribute,
System.ComponentModel.DataAnnotations (1)