34 references to ValidatorMetadata
Microsoft.AspNetCore.Mvc.Core (5)
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
540
_validatorMetadata = new ReadOnlyCollection<object>(ValidationMetadata.
ValidatorMetadata
);
ModelBinding\Metadata\DefaultValidationMetadataProvider.cs (2)
29
if (!context.ValidationMetadata.
ValidatorMetadata
.Contains(attribute))
31
context.ValidationMetadata.
ValidatorMetadata
.Add(attribute);
ModelBinding\Metadata\HasValidatorsValidationMetadataProvider.cs (1)
37
if (provider.HasValidators(context.Key.ModelType, context.ValidationMetadata.
ValidatorMetadata
))
ModelBinding\Validation\IMetadataBasedModelValidatorProvider.cs (1)
26
/// <param name="validatorMetadata">The list of metadata items for validators. <seealso cref="ValidationMetadata.
ValidatorMetadata
"/>.</param>
Microsoft.AspNetCore.Mvc.Core.Test (7)
ModelBinding\Metadata\DefaultValidationMetadataProviderTest.cs (4)
123
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);
142
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);
156
context.ValidationMetadata.
ValidatorMetadata
.Add(attribute);
162
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);
ModelBinding\ParameterBinderTest.cs (3)
155
d.
ValidatorMetadata
.Add(attribute);
162
d.
ValidatorMetadata
.Add(attribute);
171
d.
ValidatorMetadata
.Add(attribute);
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
DataAnnotationsMetadataProvider.cs (2)
384
if (!context.ValidationMetadata.
ValidatorMetadata
.Contains(attribute))
386
context.ValidationMetadata.
ValidatorMetadata
.Add(attribute);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (20)
DataAnnotationsMetadataProviderTest.cs (20)
1164
var attribute = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1189
var attribute = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute a);
1219
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1240
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1259
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1278
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1299
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1319
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1338
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1357
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1376
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1397
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1418
Assert.Contains(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1439
Assert.DoesNotContain(context.ValidationMetadata.
ValidatorMetadata
, m => m is RequiredAttribute);
1470
Assert.Equal(expected, actual: context.ValidationMetadata.
ValidatorMetadata
);
1533
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);
1548
context.ValidationMetadata.
ValidatorMetadata
.Add(attribute);
1554
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);
1569
context.ValidationMetadata.
ValidatorMetadata
.Add(attribute);
1575
var validatorMetadata = Assert.Single(context.ValidationMetadata.
ValidatorMetadata
);