22 lines
937 B
C#
22 lines
937 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Microsoft.AspNet.Mvc.ModelBinding
|
|
{
|
|
public class EmptyModelMetadataProvider : AssociatedMetadataProvider<ModelMetadata>
|
|
{
|
|
protected override ModelMetadata CreateMetadataPrototype(IEnumerable<Attribute> attributes,
|
|
Type containerType,
|
|
Type modelType,
|
|
string propertyName)
|
|
{
|
|
return new ModelMetadata(this, containerType, null, modelType, propertyName);
|
|
}
|
|
|
|
protected override ModelMetadata CreateMetadataFromPrototype(ModelMetadata prototype, Func<object> modelAccessor)
|
|
{
|
|
return new ModelMetadata(this, prototype.ContainerType, modelAccessor, prototype.ModelType, prototype.PropertyName);
|
|
}
|
|
}
|
|
}
|