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