forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPocoMetadataProvider.cs
More file actions
29 lines (25 loc) · 1011 Bytes
/
Copy pathPocoMetadataProvider.cs
File metadata and controls
29 lines (25 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
namespace ServiceStack.Html
{
public class PocoMetadataProvider : ModelMetadataProvider
{
protected virtual ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName)
{
return new ModelMetadata(this, containerType, modelAccessor, modelType, propertyName);
}
public override IEnumerable<ModelMetadata> GetMetadataForProperties(object container, Type containerType)
{
return new List<ModelMetadata>();
}
public override ModelMetadata GetMetadataForProperty(Func<object> modelAccessor, Type containerType, string propertyName)
{
var modelType = containerType; //FIX?
return new ModelMetadata(this, containerType, modelAccessor, modelType, propertyName);
}
public override ModelMetadata GetMetadataForType(Func<object> modelAccessor, Type modelType)
{
return new ModelMetadata(this, null, modelAccessor, modelType, null);
}
}
}