53 references to MetadataKind
HtmlGenerationWebSite (6)
Components\CheckViewData - LackModel.cs (4)
17writer.WriteLine($"<div class=\"col-md-3\">MetadataKind: '{ metadata.MetadataKind }'</div>"); 19if (metadata.MetadataKind == ModelMetadataKind.Property) 30writer.WriteLine($"<div class=\"col-md-3\">MetadataKind: '{ metadata.MetadataKind }'</div>"); 32if (metadata.MetadataKind == ModelMetadataKind.Property)
Components\CheckViewData.cs (2)
16writer.WriteLine($"<div class=\"col-md-3\">MetadataKind: '{ metadata.MetadataKind }'</div>"); 18if (metadata.MetadataKind == ModelMetadataKind.Property)
Microsoft.AspNetCore.Mvc.Abstractions (8)
ModelBinding\ModelMetadata.cs (8)
102public string? ParameterName => MetadataKind == ModelMetadataKind.Parameter ? Identity.Name : null; 107public string? PropertyName => MetadataKind == ModelMetadataKind.Property ? Identity.Name : null; 196/// This is only available when <see cref="MetadataKind"/> is <see cref="ModelMetadataKind.Constructor"/>. 625/// This is only available when <see cref="MetadataKind"/> is <see cref="ModelMetadataKind.Parameter"/> otherwise it will be false. 754HasDefaultValue = MetadataKind == ModelMetadataKind.Parameter && Identity.ParameterInfo!.HasDefaultValue; 757var nullability = MetadataKind switch 798switch (MetadataKind) 809return $"Unsupported MetadataKind '{MetadataKind}'.";
Microsoft.AspNetCore.Mvc.Core (24)
BindAttribute.cs (1)
68if (modelMetadata.MetadataKind == ModelMetadataKind.Parameter)
ModelBinding\Binders\CollectionModelBinder.cs (1)
384bindingContext.ModelMetadata.MetadataKind != ModelMetadataKind.Type ?
ModelBinding\Binders\ComplexObjectModelBinder.cs (4)
194switch (metadata.MetadataKind) 424if (propertyMetadata.MetadataKind == ModelMetadataKind.Property && propertyMetadata.IsReadOnly) 440Debug.Assert(property.MetadataKind == ModelMetadataKind.Property); 485Debug.Assert(parameter.MetadataKind == ModelMetadataKind.Parameter);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
483switch (metadata.MetadataKind)
ModelBinding\Metadata\DefaultModelMetadata.cs (3)
250if (MetadataKind == ModelMetadataKind.Type) 268if (MetadataKind == ModelMetadataKind.Type) 295if (MetadataKind == ModelMetadataKind.Type)
ModelBinding\ModelBinderFactory.cs (2)
308switch (_metadata.MetadataKind) 318return $"Unsupported MetadataKind '{_metadata.MetadataKind}'.";
ModelBinding\ParameterBinder.Log.cs (5)
25switch (modelMetadata.MetadataKind) 71switch (modelMetadata.MetadataKind) 117switch (modelMetadata.MetadataKind) 164switch (modelMetadata.MetadataKind) 214switch (modelMetadata.MetadataKind)
ModelBinding\Validation\ClientValidatorCache.cs (1)
27if (metadata.MetadataKind == ModelMetadataKind.Property &&
ModelBinding\Validation\ValidationVisitor.cs (3)
171if (container != null && metadata!.MetadataKind != ModelMetadataKind.Property) 173throw new ArgumentException(Resources.FormatValidationVisitor_ContainerCannotBeSpecified(metadata.MetadataKind)); 299switch (metadata.MetadataKind)
MvcCoreLoggerExtensions.cs (3)
121switch (modelMetadata.MetadataKind) 176switch (modelMetadata.MetadataKind) 216switch (modelMetadata.MetadataKind)
Microsoft.AspNetCore.Mvc.Core.Test (2)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (2)
277Assert.Equal(ModelMetadataKind.Parameter, metadata.MetadataKind); 361Assert.Equal(ModelMetadataKind.Property, metadata.MetadataKind);
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ValidationIntegrationTests.cs (1)
1541if (entry.Metadata.MetadataKind == ModelMetadataKind.Property &&
ValidationWithRecordIntegrationTests.cs (1)
1351if (entry.Metadata.MetadataKind == ModelMetadataKind.Property &&
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageCreateModelExpressionTest.cs (1)
123Assert.Equal(ModelMetadataKind.Property, modelExpression.Metadata.MetadataKind);
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewDataDictionary.cs (2)
197if (source.ModelMetadata.MetadataKind == ModelMetadataKind.Type && 443if (ModelMetadata.MetadataKind == ModelMetadataKind.Type &&
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (8)
ExpressionMetadataProviderTest.cs (8)
30Assert.Equal(ModelMetadataKind.Type, explorer.Metadata.MetadataKind); 48Assert.Equal(ModelMetadataKind.Property, explorer.Metadata.MetadataKind); 66Assert.Equal(ModelMetadataKind.Type, explorer.Metadata.MetadataKind); 88Assert.Equal(ModelMetadataKind.Property, explorer.Metadata.MetadataKind); 132Assert.Equal(expectedKind, explorer.Metadata.MetadataKind); 173Assert.Equal(ModelMetadataKind.Type, explorer.Metadata.MetadataKind); 195Assert.Equal(ModelMetadataKind.Type, explorer.Metadata.MetadataKind); 217Assert.Equal(ModelMetadataKind.Type, explorer.Metadata.MetadataKind);