using System.Collections.Generic; namespace XmlSerializersTest.Samples { [Title("Generic dictionary with custom key type")] public class GenericDictionaryCustomKey { public Dictionary<OneSimpleProperty, string> Things { get; set; } } }
<GenericDictionaryCustomKey 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:KeyValueOfOneSimplePropertystringwbwuO2LY> <d2p1:Key z:Id="3"> <Value>1</Value> </d2p1:Key> <d2p1:Value z:Id="4">one</d2p1:Value> </d2p1:KeyValueOfOneSimplePropertystringwbwuO2LY> </Things> </GenericDictionaryCustomKey>