Share via


DefaultModelMetadata Class

Definition

A default ModelMetadata implementation.

public ref class DefaultModelMetadata : Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata
public class DefaultModelMetadata : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata
type DefaultModelMetadata = class
    inherit ModelMetadata
Public Class DefaultModelMetadata
Inherits ModelMetadata
Inheritance
DefaultModelMetadata

Constructors

DefaultModelMetadata(IModelMetadataProvider, ICompositeMetadataDetailsProvider, DefaultMetadataDetails, DefaultModelBindingMessageProvider)

Creates a new DefaultModelMetadata.

DefaultModelMetadata(IModelMetadataProvider, ICompositeMetadataDetailsProvider, DefaultMetadataDetails, ModelBindingMessageProvider)

Creates a new DefaultModelMetadata.

DefaultModelMetadata(IModelMetadataProvider, ICompositeMetadataDetailsProvider, DefaultMetadataDetails)

Creates a new DefaultModelMetadata.

Properties

AdditionalValues

Gets a collection of additional information about the model.

Attributes

Gets the set of attributes for the current instance.

BinderModelName

Gets the name of a model if specified explicitly using IModelNameProvider.

BinderType

Gets the Type of an IModelBinder of a model if specified explicitly using IBinderTypeProviderMetadata.

BindingMetadata

Gets the BindingMetadata for the current instance.

BindingSource

Gets a binder metadata for this model.

BoundConstructor

Gets ModelMetadata instance for a constructor of a record type that is used during binding and validation.

BoundConstructor

Gets ModelMetadata instance for a constructor of a record type that is used during binding and validation.

(Inherited from ModelMetadata)
BoundConstructorInvoker

Gets a delegate that invokes the bound constructor BoundConstructor if non-null.

BoundConstructorInvoker

Gets a delegate that invokes the bound constructor BoundConstructor if non-null.

(Inherited from ModelMetadata)
BoundConstructorParameters

Gets the collection of ModelMetadata instances for parameters on a BoundConstructor. This is only available when MetadataKind is Constructor.

BoundConstructorParameters

Gets the collection of ModelMetadata instances for parameters on a BoundConstructor. This is only available when MetadataKind is Constructor.

(Inherited from ModelMetadata)
ContainerMetadata

Gets the metadata for ContainerType if this metadata is for a property; null otherwise.

ContainerMetadata

Gets the metadata for ContainerType if this metadata is for a property; null otherwise.

(Inherited from ModelMetadata)
ContainerType

Gets the type containing the property if this metadata is for a property; null otherwise.

(Inherited from ModelMetadata)
ConvertEmptyStringToNull

Gets a value indicating whether or not to convert an empty string value or one containing only whitespace characters to null when representing a model as text.

DataTypeName

Gets the name of the model's datatype. Overrides ModelType in some display scenarios.

Description

Gets the description of the model.

DisplayFormatString

Gets the format string (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) used to display the model.

DisplayMetadata

Gets the DisplayMetadata for the current instance.

DisplayName

Gets the display name of the model.

EditFormatString

Gets the format string (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) used to edit the model.

ElementMetadata

Gets the ModelMetadata for elements of ModelType if that Type implements IEnumerable.

ElementType

Gets the Type for elements of ModelType if that Type implements IEnumerable.

(Inherited from ModelMetadata)
EnumGroupedDisplayNamesAndValues

Gets the ordered and grouped display names and values of all Enum values in UnderlyingOrModelType.

EnumNamesAndValues

Gets the names and values of all Enum values in UnderlyingOrModelType.

HasNonDefaultEditFormat

Gets a value indicating whether EditFormatString has a non-null, non-empty value different from the default for the datatype.

HasValidators

Gets a value that indicates if the model, or one of its properties or elements, has associated validators.

HasValidators

Gets a value that indicates if the model, or one of its properties or elements, has associated validators.

(Inherited from ModelMetadata)
HideSurroundingHtml

Gets a value indicating whether the "HiddenInput" display template should return string.Empty (not the expression value) and whether the "HiddenInput" editor template should not also return the expression value (together with the hidden <input> element).

HtmlEncode

Gets a value indicating whether the value should be HTML-encoded.

Identity

Gets the key for the current instance.

(Inherited from ModelMetadata)
IsBindingAllowed

Gets a value indicating whether or not the model value can be bound by model binding. This is only applicable when the current instance represents a property.

IsBindingRequired

Gets a value indicating whether or not the model value is required by model binding. This is only applicable when the current instance represents a property.

IsCollectionType

Gets a value indicating whether or not ModelType is a collection type.

(Inherited from ModelMetadata)
IsComplexType

Gets a value indicating whether ModelType is a complex type.

(Inherited from ModelMetadata)
IsEnum

Gets a value indicating whether UnderlyingOrModelType is for an Enum.

IsEnumerableType

Gets a value indicating whether or not ModelType is an enumerable type.

(Inherited from ModelMetadata)
IsFlagsEnum

Gets a value indicating whether UnderlyingOrModelType is for an Enum with an associated FlagsAttribute.

IsNullableValueType

Gets a value indicating whether or not ModelType is a Nullable<T>.

(Inherited from ModelMetadata)
IsReadOnly

Gets a value indicating whether or not the model value is read-only. This is only applicable when the current instance represents a property.

IsReferenceOrNullableType

Gets a value indicating whether or not ModelType allows null values.

(Inherited from ModelMetadata)
IsRequired

Gets a value indicating whether or not the model value is required. This is only applicable when the current instance represents a property.

MetadataKind

Gets a value indicating the kind of metadata element represented by the current instance.

(Inherited from ModelMetadata)
ModelBindingMessageProvider

Gets the ModelBindingMessageProvider instance.

ModelType

Gets the model type represented by the current instance.

(Inherited from ModelMetadata)
Name

Gets the name of the parameter or property if this metadata is for a parameter or property; null otherwise i.e. if this is the metadata for a type.

(Inherited from ModelMetadata)
NullDisplayText

Gets the text to display when the model is null.

Order

Gets a value indicating where the current metadata should be ordered relative to other properties in its containing type.

ParameterName

Gets the name of the parameter if this metadata is for a parameter; null otherwise.

(Inherited from ModelMetadata)
Placeholder

Gets the text to display as a placeholder value for an editor. By default, this is configured using Prompt.

Properties

Gets the collection of ModelMetadata instances for the model's properties.

PropertyFilterProvider

Gets the IPropertyFilterProvider, which can determine which properties should be model bound.

PropertyGetter

Gets a property getter delegate to get the property value from a model object.

PropertyName

Gets the name of the property if this metadata is for a property; null otherwise.

(Inherited from ModelMetadata)
PropertySetter

Gets a property setter delegate to set the property value on a model object.

PropertyValidationFilter

Gets an IPropertyValidationFilter implementation that indicates whether this model should be validated. If null, properties with this ModelMetadata are validated.

PropertyValidationFilter

Gets an IPropertyValidationFilter implementation that indicates whether this model should be validated. If null, properties with this ModelMetadata are validated.

(Inherited from ModelMetadata)
ShowForDisplay

Gets a value that indicates whether the property should be displayed in read-only views.

ShowForEdit

Gets a value that indicates whether the property should be displayed in editable views.

SimpleDisplayProperty

Gets a value which is the name of the property used to display the model.

TemplateHint

Gets a string used by the templating system to discover display-templates and editor-templates. Use UIHintAttribute to specify.

UnderlyingOrModelType

Gets the underlying type argument if ModelType inherits from Nullable<T>. Otherwise gets ModelType.

(Inherited from ModelMetadata)
ValidateChildren

Gets a value that indicates whether properties or elements of the model should be validated.

ValidationMetadata

Gets the ValidationMetadata for the current instance.

ValidatorMetadata

Gets a collection of metadata items for validators.

Methods

Equals(ModelMetadata) (Inherited from ModelMetadata)
Equals(Object) (Inherited from ModelMetadata)
GetDisplayName()

Gets a display name for the model.

(Inherited from ModelMetadata)
GetHashCode() (Inherited from ModelMetadata)
GetMetadataForProperties(Type)

Supplies metadata describing the properties of a Type.

GetMetadataForProperties(Type)

Supplies metadata describing the properties of a Type.

(Inherited from ModelMetadata)
GetMetadataForType(Type)

Supplies metadata describing a Type.

GetMetadataForType(Type)

Supplies metadata describing a Type.

(Inherited from ModelMetadata)

Extension Methods

GetMetadataForProperty(IModelMetadataProvider, Type, String)

Gets a ModelMetadata for property identified by the provided containerType and propertyName.

GetModelExplorerForType(IModelMetadataProvider, Type, Object)

Gets a ModelExplorer for the provided modelType and model.

Applies to