using System.Collections.Generic; namespace XmlSerializersTest.Samples { [Title("Generic dictionary with custom value type")] public class GenericDictionaryCustomValue { public Dictionary<string, OneSimpleProperty> Things { get; set; } } }
<GenericDictionaryCustomValue xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://schemas.datacontract.org/2004/07/XmlSerializersTest.Samples"> <Things xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" z:Id="2" z:Size="1"> <d2p1:KeyValueOfstringOneSimplePropertyLWKRds8Z> <d2p1:Key z:Id="3">one</d2p1:Key> <d2p1:Value z:Id="4"> <Value>1</Value> </d2p1:Value> </d2p1:KeyValueOfstringOneSimplePropertyLWKRds8Z> </Things> </GenericDictionaryCustomValue>