<parameter>

 

Specifies the generic parameter when a declared type is a generic type.

<system.runtime.serialization>
<dataContractSerializer>
<declaredTypes> Element
<add> element for <declaredTypes>
<knownType> Element
<parameter> Element

  
<parameter index="integer"  
                      type=String" />  

The following sections describe attributes, child elements, and parent elements.

Attributes

AttributeDescription
indexWhen the declared type is a generic type, specifies the generic parameter that will return the known type.
typeA string that describes the known type used for serialization and deserialization.
ValueDescription
"0"The first parameter in the generic type. For example, a List<T> has only one parameter. If it is used as the declared type, the index would be set to "0".
"1"The second parameter in a generic type. For example, a Dictionary<TKey, TValue> has two parameters. If the known type is returned by the second parameter, set the index attribute to "1".

Child Elements

None.

Parent Elements

ElementDescription
<knownType>Specifies a known type that can be returned by a field or property of the declared type.

For more information about known types, see Data Contract Known Types and DataContractSerializer.

See the <dataContractSerializer> for an example of using this element.

This configuration element cannot have both attributes at the same time. If both attributes are set, a ConfigurationErrorsException occurs.

DataContractSerializer
Data Contract Known Types
<dataContractSerializer>
<add>

Show: