DataAnnotationsModelMetadataProvider Class


Implements the default model metadata provider for ASP.NET MVC.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy



public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider
public ref class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider
type DataAnnotationsModelMetadataProvider = 
        inherit AssociatedMetadataProvider
Public Class DataAnnotationsModelMetadataProvider
    Inherits AssociatedMetadataProvider


Name Description
System_CAPS_pubmethod DataAnnotationsModelMetadataProvider()

Initializes a new instance of the DataAnnotationsModelMetadataProvider class.


Name Description
System_CAPS_protmethod CreateMetadata(IEnumerable<Attribute>, Type, Func<Object>, Type, String)

Gets the metadata for the specified property.(Overrides AssociatedMetadataProvider.CreateMetadata(IEnumerable<Attribute>, Type, Func<Object>, Type, String).)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod FilterAttributes(Type, PropertyDescriptor, IEnumerable<Attribute>)

Gets a list of attributes.(Inherited from AssociatedMetadataProvider.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetMetadataForProperties(Object, Type)

Returns a list of properties for the model.(Inherited from AssociatedMetadataProvider.)

System_CAPS_protmethod GetMetadataForProperty(Func<Object>, Type, PropertyDescriptor)

Returns the metadata for the specified property using the container type and property descriptor.(Inherited from AssociatedMetadataProvider.)

System_CAPS_pubmethod GetMetadataForProperty(Func<Object>, Type, String)

Returns the metadata for the specified property using the container type and property name.(Inherited from AssociatedMetadataProvider.)

System_CAPS_pubmethod GetMetadataForType(Func<Object>, Type)

Returns the metadata for the specified property using the type of the model.(Inherited from AssociatedMetadataProvider.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod GetTypeDescriptor(Type)

Returns the type descriptor from the specified type.(Inherited from AssociatedMetadataProvider.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)


The ModelMetadataProviders class sets this class as the default metadata provider for the MVC framework. You typically do not have to use this class directly. If you develop a custom attribute-based metadata provider, you can use this implementation as a guide.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top