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.

Share DefaultMetadataDetails between bool and bool? (and similar pairs) #2985

@dougbu

Description

@dougbu

With the exception of DefaultMetadataDetails.Key, metadata about a ValueType and its Nullable<T> pair is identical and should not be stored separately. Further the ModelMetadataIdentity of a Nullable<T> property and it's ModelExplorer should not change when HasValue changes.

This is a follow-on from #2539. That issue relates to when ViewDataDictionary requests a new ModelMetadata instance. This is about making the returned metadata (when required) as close as possible for bool and bool?. In addition IMetadataDetailsProvider instances should be queried once about T and not twice i.e. not also about Nullable<T>.

There may be a slight performance improvement in not querying the IMetadataDetailsProvider instances twice. But the main issue is keeping the metadata consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions