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

Extend ModelMetadata to reduce ugliness #5686

Closed
dougbu opened this issue Jan 13, 2017 · 0 comments
Closed

Extend ModelMetadata to reduce ugliness #5686

dougbu opened this issue Jan 13, 2017 · 0 comments

Comments

@dougbu
Copy link
Member

dougbu commented Jan 13, 2017

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants