I want to serialize List of tuples to XML Attributes. For example:
List<Tuple<String, String>> attributes = new List<Tuple<String, String>>();
attributes.Add(New Tuple("att1", value1"));
attributes.Add(New Tuple("att2", value2"));
It should appear as:
<Root att1="value1" att2="value2">
</Root>
Edit: I have a class like this which I am serializing using XmlSerializer:
public class Root
{
List<Tuple<String, String>> attributes = new List<Tuple<String, String>>();
//other attributes and elements exist in this class
}
Is there an easy way of doing it?
Thanks