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" xmlns="http://schemas.datacontract.org/2004/07/XmlSerializersTest.Samples"> <Things xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfOneSimplePropertystringwbwuO2LY> <d2p1:Key> <Value>1</Value> </d2p1:Key> <d2p1:Value>one</d2p1:Value> </d2p1:KeyValueOfOneSimplePropertystringwbwuO2LY> </Things> </GenericDictionaryCustomKey>