From d53295fab29be15019f700e93a877a374307759a Mon Sep 17 00:00:00 2001 From: Youssef Fahmy Date: Tue, 9 Jun 2026 16:19:29 +0200 Subject: [PATCH 1/2] Add doc comment on AsyncValidationAttribute to not make threading assumptions --- .../ComponentModel/DataAnnotations/AsyncValidationAttribute.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs index 2de0d14ffc2219..d881503900ed4a 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.DataAnnotations { /// /// Base class for validation attributes that require asynchronous operations, such as database lookups or API calls. + /// Derived classes should never make any threading assumptions. Implementations of this attribute may or may not be called in parallel. /// public abstract class AsyncValidationAttribute : ValidationAttribute { From 845c46f64ac062ad0768f8a9da9b77b0d0d03357 Mon Sep 17 00:00:00 2001 From: Youssef Fahmy Date: Wed, 10 Jun 2026 06:43:34 +0200 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../ComponentModel/DataAnnotations/AsyncValidationAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs index d881503900ed4a..e5d3c0b106aaed 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AsyncValidationAttribute.cs @@ -8,7 +8,7 @@ namespace System.ComponentModel.DataAnnotations { /// /// Base class for validation attributes that require asynchronous operations, such as database lookups or API calls. - /// Derived classes should never make any threading assumptions. Implementations of this attribute may or may not be called in parallel. + /// Derived implementations must be thread-safe, as instances of this attribute may be invoked concurrently from multiple threads. /// public abstract class AsyncValidationAttribute : ValidationAttribute {