4 instantiations of DefaultModelMetadata
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
317
return new
DefaultModelMetadata
(this, DetailsProvider, entry, ModelBindingMessageProvider);
Microsoft.AspNetCore.Mvc.Core.Test (3)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (3)
957
var metadata1 = new
DefaultModelMetadata
(metadataProvider.Object, detailsProvider.Object, cache);
977
var metadata1 = new
DefaultModelMetadata
(metadataProvider.Object, detailsProvider.Object, cache);
1598
return new
DefaultModelMetadata
(
185 references to DefaultModelMetadata
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
270
parameter.ModelMetadata is
DefaultModelMetadata
defaultModelMetadata &&
Microsoft.AspNetCore.Mvc.Core (13)
ModelBinding\Metadata\BindingSourceMetadataProvider.cs (1)
9
/// Provides <see cref="BindingMetadata"/> for a <see cref="
DefaultModelMetadata
"/>.
ModelBinding\Metadata\DefaultMetadataDetails.cs (1)
9
/// Holds associated metadata objects for a <see cref="
DefaultModelMetadata
"/>.
ModelBinding\Metadata\DefaultModelMetadata.cs (7)
38
/// Creates a new <see cref="
DefaultModelMetadata
"/>.
52
/// Creates a new <see cref="
DefaultModelMetadata
"/>.
448
var visited = new HashSet<
DefaultModelMetadata
>();
462
internal static bool CalculateHasValidators(HashSet<
DefaultModelMetadata
> visited, ModelMetadata metadata)
466
if (metadata?.GetType() != typeof(
DefaultModelMetadata
))
473
var
defaultModelMetadata = (
DefaultModelMetadata
)metadata;
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
312
/// <see cref="
DefaultModelMetadata
"/> .Override this method to create a <see cref="ModelMetadata"/>
ModelBinding\Metadata\IBindingMetadataProvider.cs (1)
9
/// Provides <see cref="BindingMetadata"/> for a <see cref="
DefaultModelMetadata
"/>.
ModelBinding\Metadata\IDisplayMetadataProvider.cs (1)
9
/// Provides <see cref="DisplayMetadata"/> for a <see cref="
DefaultModelMetadata
"/>.
ModelBinding\Metadata\IValidationMetadataProvider.cs (1)
9
/// Provides <see cref="ValidationMetadata"/> for a <see cref="
DefaultModelMetadata
"/>.
Microsoft.AspNetCore.Mvc.Core.Test (170)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (30)
21
var
defaultMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
34
var
metadata1 = Assert.IsType<
DefaultModelMetadata
>(provider.GetMetadataForType(typeof(ModelType)));
35
var
metadata2 = Assert.IsType<
DefaultModelMetadata
>(provider.GetMetadataForType(typeof(ModelType)));
122
var properties1 = provider.GetMetadataForProperties(typeof(ModelType)).Cast<
DefaultModelMetadata
>().ToArray();
123
var properties2 = provider.GetMetadataForProperties(typeof(ModelType)).Cast<
DefaultModelMetadata
>().ToArray();
144
var
metadata1 = Assert.IsType<
DefaultModelMetadata
>(provider.GetMetadataForType(typeof(ModelType)));
145
var
metadata2 = Assert.IsType<
DefaultModelMetadata
>(provider.GetMetadataForType(typeof(ModelType)));
161
var
defaultMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
212
var
defaultMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
231
var
defaultMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
280
var
defaultModelMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
294
var
defaultPropertyMetadata = Assert.IsType<
DefaultModelMetadata
>(p);
303
var
defaultPropertyMetadata = Assert.IsType<
DefaultModelMetadata
>(p);
364
var
defaultModelMetadata = Assert.IsType<
DefaultModelMetadata
>(metadata);
378
var
defaultPropertyMetadata = Assert.IsType<
DefaultModelMetadata
>(p);
387
var
defaultPropertyMetadata = Assert.IsType<
DefaultModelMetadata
>(p);
ModelBinding\Metadata\DefaultModelMetadataTest.cs (139)
27
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
87
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
106
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
136
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
173
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
210
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
239
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
266
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
306
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
333
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
360
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
383
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
404
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
426
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
447
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
466
var expectedProperties = new
DefaultModelMetadata
[]
489
var
metadata = new DefaultModelMetadata(provider.Object, detailsProvider, cache);
541
var expectedProperties = new List<
DefaultModelMetadata
>();
561
var
metadata = new DefaultModelMetadata(provider.Object, detailsProvider, cache);
646
var expectedProperties = new List<
DefaultModelMetadata
>();
673
var
metadata = new DefaultModelMetadata(provider.Object, detailsProvider, cache);
693
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
714
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
741
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
760
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
779
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
798
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
822
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
849
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
887
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
912
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
937
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);
957
var
metadata1 = new DefaultModelMetadata(metadataProvider.Object, detailsProvider.Object, cache);
977
var
metadata1 = new DefaultModelMetadata(metadataProvider.Object, detailsProvider.Object, cache);
994
var
modelMetadata = CreateModelMetadata(modelIdentity, Mock.Of<IModelMetadataProvider>(), hasValidators: false);
997
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1012
var
modelMetadata = CreateModelMetadata(modelIdentity, Mock.Of<IModelMetadataProvider>(), hasValidators: false);
1015
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1028
var
modelMetadata = CreateModelMetadata(modelIdentity, Mock.Of<IModelMetadataProvider>(), hasValidators: false);
1031
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1042
var
modelMetadata = CreateModelMetadata(modelIdentity, Mock.Of<IModelMetadataProvider>(), hasValidators: true);
1045
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1056
var
modelMetadata = CreateModelMetadata(modelIdentity, Mock.Of<IModelMetadataProvider>(), hasValidators: null);
1059
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1072
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1084
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1097
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1100
var
property1Metadata = CreateModelMetadata(property1Identity, metadataProvider.Object, hasValidators: false);
1103
var
property2Metadata = CreateModelMetadata(property2Identity, metadataProvider.Object, hasValidators: true);
1111
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1124
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1127
var
propertyMetadata = CreateModelMetadata(propertyIdentity, metadataProvider.Object, hasValidators: null);
1135
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1148
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1151
var
property1Metadata = CreateModelMetadata(property1Identity, metadataProvider.Object, hasValidators: false);
1154
var
property2Metadata = CreateModelMetadata(property2Identity, metadataProvider.Object, hasValidators: false);
1162
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1175
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1178
var
employeeIdMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1180
var
employeeUnitMetadata = CreateModelMetadata(employeeUnit, metadataProvider.Object, hasValidators: false);
1182
var
employeeManagerMetadata = CreateModelMetadata(employeeManager, metadataProvider.Object, hasValidators: false);
1184
var
employeeEmployeesMetadata = CreateModelMetadata(employeeEmployees, metadataProvider.Object, hasValidators: false);
1188
var
unitHeadMetadata = CreateModelMetadata(unitHead, metadataProvider.Object, hasValidators: false);
1190
var
unitIdMetadata = CreateModelMetadata(unitId, metadataProvider.Object, hasValidators: true); // BusinessUnit.Id has validators.
1203
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1216
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1219
var
employeeIdMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1221
var
employeeUnitMetadata = CreateModelMetadata(employeeUnit, metadataProvider.Object, hasValidators: false);
1223
var
employeeManagerMetadata = CreateModelMetadata(employeeManager, metadataProvider.Object, hasValidators: false);
1225
var
employeeEmployeesMetadata = CreateModelMetadata(employeeEmployees, metadataProvider.Object, hasValidators: false);
1229
var
unitHeadMetadata = CreateModelMetadata(unitHead, metadataProvider.Object, hasValidators: true); // BusinessUnit.Head has validators
1231
var
unitIdMetadata = CreateModelMetadata(unitId, metadataProvider.Object, hasValidators: false);
1246
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1259
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1262
var
employeeIdMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, false);
1264
var
employeeEmployeesMetadata = CreateModelMetadata(employeeEmployees, metadataProvider.Object, hasValidators: false);
1275
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1288
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1291
var
employeeIdMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1293
var
employeeUnitMetadata = CreateModelMetadata(employeeUnit, metadataProvider.Object, hasValidators: false);
1295
var
employeeManagerMetadata = CreateModelMetadata(employeeManager, metadataProvider.Object, hasValidators: false);
1297
var
employeeEmployeesIdMetadata = CreateModelMetadata(employeeEmployeesId, metadataProvider.Object, hasValidators: false);
1301
var
unitHeadMetadata = CreateModelMetadata(unitHead, metadataProvider.Object, hasValidators: false);
1303
var
unitIdMetadata = CreateModelMetadata(unitId, metadataProvider.Object, hasValidators: false);
1318
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1335
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1339
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: false);
1343
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: false);
1345
var
constructorMetadata = CreateModelMetadata(
1363
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1379
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1383
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: false);
1387
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: true);
1389
var
constructorMetadata = CreateModelMetadata(ModelMetadataIdentity.ForConstructor(constructor, modelType), metadataProvider.Object, hasValidators: null);
1404
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1424
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1428
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: false);
1432
var
property2Metadata = CreateModelMetadata(property2Id, metadataProvider.Object, hasValidators: false);
1436
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: false);
1438
var
constructorMetadata = CreateModelMetadata(
1454
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1469
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1473
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: false);
1477
var
property2Metadata = CreateModelMetadata(property2Id, metadataProvider.Object, hasValidators: false);
1481
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: true);
1483
var
constructorMetadata = CreateModelMetadata(
1499
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1514
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1518
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: false);
1522
var
property2Metadata = CreateModelMetadata(property2Id, metadataProvider.Object, hasValidators: true);
1526
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: false);
1528
var
constructorMetadata = CreateModelMetadata(
1544
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1559
var
modelMetadata = CreateModelMetadata(modelIdentity, metadataProvider.Object, hasValidators: false);
1563
var
propertyMetadata = CreateModelMetadata(propertyId, metadataProvider.Object, hasValidators: true);
1566
var
property2Metadata = CreateModelMetadata(property2Id, metadataProvider.Object, hasValidators: false);
1569
var
parameterMetadata = CreateModelMetadata(parameterId, metadataProvider.Object, hasValidators: false);
1571
var
constructorMetadata = CreateModelMetadata(
1587
var result =
DefaultModelMetadata
.CalculateHasValidators(new HashSet<
DefaultModelMetadata
>(), modelMetadata);
1593
private static
DefaultModelMetadata
CreateModelMetadata(
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
174
var
metadata = new DefaultModelMetadata(metadataProvider, detailsProvider, cache);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
FormatWeekHelperTest.cs (1)
31
var
metadata = new DefaultModelMetadata(provider, detailsProvider, cache);