Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
ASP.NET
ASP.NET MVC 2
System.Web.Mvc
Collapse All/Expand All Collapse All
.NET Framework Class Library
DataAnnotationsModelMetadataProvider Class

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

System..::.Object
  System.Web.Mvc..::.ModelMetadataProvider
    System.Web.Mvc..::.AssociatedMetadataProvider
      System.Web.Mvc..::.DataAnnotationsModelMetadataProvider

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)
Visual Basic
Public Class DataAnnotationsModelMetadataProvider _
    Inherits AssociatedMetadataProvider
C#
public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider
Visual C++
public ref class DataAnnotationsModelMetadataProvider : public AssociatedMetadataProvider

The DataAnnotationsModelMetadataProvider type exposes the following members.

  NameDescription
Public methodDataAnnotationsModelMetadataProviderInitializes a new instance of the DataAnnotationsModelMetadataProvider class.
Top
  NameDescription
Protected methodCreateMetadataGets the metadata for the specified property. (Overrides AssociatedMetadataProvider..::.CreateMetadata(IEnumerable<(Of <(Attribute>)>), Type, Func<(Of <(Object>)>), Type, String).)
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFilterAttributesGets a list of attributes. (Inherited from AssociatedMetadataProvider.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetMetadataForPropertiesReturns a list of properties for the model. (Inherited from AssociatedMetadataProvider.)
Protected methodGetMetadataForProperty(Func<(Of <(Object>)>), Type, PropertyDescriptor)Returns the metadata for the specified property using the container type and property descriptor. (Inherited from AssociatedMetadataProvider.)
Public methodGetMetadataForProperty(Func<(Of <(Object>)>), Type, String)Returns the metadata for the specified property using the container type and property name. (Inherited from AssociatedMetadataProvider.)
Public methodGetMetadataForTypeReturns the metadata for the specified property using the type of the model. (Inherited from AssociatedMetadataProvider.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodGetTypeDescriptorReturns the type descriptor from the specified type. (Inherited from AssociatedMetadataProvider.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker