This parameter allows to instantiate objects only at the moment of their use. Here is an example of generated code :
public List<dvd> Dvds { get { if ((dvdsField == null)) { dvdsField = new List<dvd>(); } return dvdsField; } set { ... } } |
Specified Conditional Serialization Pattern allows to exclude properties during the serialization process.
This parameter is used to generate additional properties which are used to determine whether a property should be serialized or not. There are several possibilities:
None | No such property generated | ||
Specified | Generates a property ([PropertyName]Specified) that allows to indicate if a property must be taken into account in the serialization. In the example below if IsValidSpecified is set to true, the IsValid property will be taken into the serialization process. Otherwise the property will be ignored.
In the example below, the code shows that it is necessary for each of the properties to implicitly specify that the serializer must include the property :
|