This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
DefaultMetadataDetails.cs
77 lines (65 loc) · 2.71 KB
/
DefaultMetadataDetails.cs
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
{
/// <summary>
/// Holds associated metadata objects for a <see cref="DefaultModelMetadata"/>.
/// </summary>
/// <remarks>
/// Any modifications to the data must be thread-safe for multiple readers and writers.
/// </remarks>
public class DefaultMetadataDetails
{
/// <summary>
/// Creates a new <see cref="DefaultMetadataDetails"/>.
/// </summary>
/// <param name="key">The <see cref="ModelMetadataIdentity"/>.</param>
/// <param name="attributes">The set of model attributes.</param>
public DefaultMetadataDetails(ModelMetadataIdentity key, ModelAttributes attributes)
{
if (attributes == null)
{
throw new ArgumentNullException(nameof(attributes));
}
Key = key;
ModelAttributes = attributes;
}
/// <summary>
/// Gets or sets the set of model attributes.
/// </summary>
public ModelAttributes ModelAttributes { get; }
/// <summary>
/// Gets or sets the <see cref="Metadata.BindingMetadata"/>.
/// </summary>
public BindingMetadata BindingMetadata { get; set; }
/// <summary>
/// Gets or sets the <see cref="Metadata.DisplayMetadata"/>.
/// </summary>
public DisplayMetadata DisplayMetadata { get; set; }
/// <summary>
/// Gets or sets the <see cref="ModelMetadataIdentity"/>.
/// </summary>
public ModelMetadataIdentity Key { get; }
/// <summary>
/// Gets or sets the <see cref="ModelMetadata"/> entries for the model properties.
/// </summary>
public ModelMetadata[] Properties { get; set; }
/// <summary>
/// Gets or sets a property getter delegate to get the property value from a model object.
/// </summary>
public Func<object, object> PropertyGetter { get; set; }
/// <summary>
/// Gets or sets a property setter delegate to set the property value on a model object.
/// </summary>
public Action<object, object> PropertySetter { get; set; }
/// <summary>
/// Gets or sets the <see cref="Metadata.ValidationMetadata"/>
/// </summary>
public ValidationMetadata ValidationMetadata { get; set; }
/// <summary>
/// Gets or sets the <see cref="ModelMetadata"/> of the container type.
/// </summary>
public ModelMetadata ContainerMetadata { get; set; }
}
}