diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DeniedValuesAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DeniedValuesAttribute.cs index bfc9fc2023e950..500a7ba117e26f 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DeniedValuesAttribute.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DeniedValuesAttribute.cs @@ -43,9 +43,9 @@ public DeniedValuesAttribute(params object?[] values) /// public override bool IsValid(object? value) { - foreach (object? allowed in Values) + foreach (object? denied in Values) { - if (allowed is null ? value is null : allowed.Equals(value)) + if (denied is null ? value is null : denied.Equals(value)) { return false; }