Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Extend ModelMetadata to reduce ugliness #5686

@dougbu

Description

@dougbu

A couple of potential ModelMetadata additions came up in offline conversations about #5676:

  • have ModelMetadata implement IModelMetadataProvider. This should significantly reduce the shenanigans we have around ensuring both ModelMetadata and its provider are available. E.g.
    • many contexts contain both ModelMetadata and IModelMetadataProvider properties.
    • ModelBinderFactory gets the provider from DI though ModelBinderFactoryContext contains a ModelMetadata property.
    • ExpressionMetadataProvider methods contain both ViewDataDictionary (which has ModelMetadata) and IModelMetadataProvider parameters.
  • add a ContainerMetadata property. This seem slightly redundant if ModelMetadata implements IModelMetadataProvider but would be convenient.
    • Note information about the containing property is not static and cannot be maintained in ModelMetadata.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions