description | title | ms.date | ms.assetid |
---|---|---|---|
Learn more about: <Field> Element (.NET Native) |
<Field> Element (.NET Native) |
03/30/2017 |
6a14125f-1a8d-41a1-8a32-659ca0ad12de |
Applies runtime reflection policy to a field.
<Field Name="field_name"
Browse="policy_type"
Dynamic="policy_type"
Serialize="policy_type" />
The following sections describe attributes, child elements, and parent elements.
Attribute | Attribute type | Description |
---|---|---|
Name |
General | Required attribute. Specifies the field name. |
Browse |
Reflection | Optional attribute. Controls querying for information about or enumerating the field but does not enable any dynamic access at run time. |
Dynamic |
Reflection | Optional attribute. Controls runtime access to the field to enable dynamic programming. This policy ensures that a field can be set or retrieved dynamically at run time. |
Serialize |
Serialization | Optional attribute. Controls runtime access to a field to enable type instances to be serialized by libraries such as the Newtonsoft JSON serializer or to be used for data binding. |
Value | Description |
---|---|
method_name | The field name. The type of the field is defined by the parent <Type> or <TypeInstantiation> element. |
Value | Description |
---|---|
policy_setting | The setting to apply to this policy type for the field. Possible values are Auto , Excluded , Included , and Required . For more information, see Runtime Directive Policy Settings. |
None.
Element | Description |
---|---|
<Type> | Applies reflection policy to a type and all its members. |
<TypeInstantiation> | Applies reflection policy to a constructed generic type and all its members. |
If a field's policy is not explicitly defined, it inherits the runtime policy of its parent element.