/// <summary> /// Initializes a new instance of the <see cref="CachedDataAnnotationsModelMetadata"/> class. /// </summary> /// <param name="provider">The metadata provider.</param> /// <param name="containerType">The type of the container.</param> /// <param name="modelType">The type of the model.</param> /// <param name="propertyName">The name of the property.</param> /// <param name="attributes">The attributes that provides data for the initialization.</param> public CachedDataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, IEnumerable <Attribute> attributes) : base(provider, containerType, modelType, propertyName, new CachedDataAnnotationsMetadataAttributes(attributes)) { Contract.Requires(attributes != null); }
/// <summary> /// Initializes a new instance of the <see cref="CachedDataAnnotationsMetadataAttributes"/> class. /// </summary> /// <param name="provider">The provider.</param> /// <param name="containerType">The type of container.</param> /// <param name="modelType">The type of the model.</param> /// <param name="propertyName">The name of the property.</param> /// <param name="prototypeCache">The prototype cache.</param> /// <remarks>Constructor for creating the prototype instances of the metadata class.</remarks> protected CachedModelMetadata(DataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, TPrototypeCache prototypeCache) : base(provider, containerType, null, modelType, propertyName) { this.PrototypeCache = prototypeCache; }