This repository was archived by the owner on Dec 14, 2018. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork2.1k
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
ExtendModelMetadata to reduce ugliness #5686
Closed
Description
A couple of potentialModelMetadata additions came up in offline conversations about#5676:
- have
ModelMetadataimplementIModelMetadataProvider. This should significantly reduce the shenanigans we have around ensuring bothModelMetadataand its provider are available. E.g.- many contexts contain both
ModelMetadataandIModelMetadataProviderproperties. ModelBinderFactorygets the provider from DI thoughModelBinderFactoryContextcontains aModelMetadataproperty.ExpressionMetadataProvidermethods contain bothViewDataDictionary(which hasModelMetadata) andIModelMetadataProviderparameters.
- many contexts contain both
- add a
ContainerMetadataproperty. This seem slightly redundant ifModelMetadataimplementsIModelMetadataProviderbut would be convenient.- Note information about the containingproperty is not static and cannot be maintained in
ModelMetadata.
- Note information about the containingproperty is not static and cannot be maintained in