C# Class Framework.Mvc.Metadata.MetadataProvider

Customize entity metadata provider.
Inheritance: System.Web.Mvc.DataAnnotationsModelMetadataProvider
显示文件 Open project: coreframework/Core-Framework

Public Methods

Method Description
MetadataProvider ( bool localizeDisplayNames, bool localizeValidators ) : System

Initializes a new instance of the MetadataProvider class.

Protected Methods

Method Description
CreateMetadata ( IEnumerable attributes, Type containerType, Func modelAccessor, Type modelType, String propertyName ) : ModelMetadata

Gets the metadata for the specified property.

Private Methods

Method Description
LocalizeDisplayName ( ModelMetadata metadata, Type modelType, String propertyName ) : void
LocalizeValidators ( IEnumerable attributes, Type modelType, String propertyName ) : void
ProcessFileUploadOptions ( IEnumerable attributes, ModelMetadata metadata ) : void
ProcessImageUploadOptions ( IEnumerable attributes, ModelMetadata metadata ) : void

Method Details

CreateMetadata() protected method

Gets the metadata for the specified property.
protected CreateMetadata ( IEnumerable attributes, Type containerType, Func modelAccessor, Type modelType, String propertyName ) : ModelMetadata
attributes IEnumerable The attributes.
containerType System.Type The type of the container.
modelAccessor Func The model accessor.
modelType System.Type The type of the model.
propertyName String The name of the property.
return ModelMetadata

MetadataProvider() public method

Initializes a new instance of the MetadataProvider class.
public MetadataProvider ( bool localizeDisplayNames, bool localizeValidators ) : System
localizeDisplayNames bool if set to true model display names should be localized.
localizeValidators bool if set to true validation attributes error messages should be localized.
return System