I have been able to serialize an IEnumerable this way:
[XmlArray("TRANSACTIONS")]
[XmlArrayItem("TRANSACTION", typeof(Record))]
public IEnumerable<BudgetRecord> Records
{
get
{
foreach(Record br in _budget)
{
yield return br;
}
}
}
However, I realised that now I need a dictionary containing a collection Dictionary<string, RecordCollection> (RecordCollection implements IEnumerable).
How can I achieve that?
Take a look at the following blog post
http://blogs.msdn.com/b/psheill/archive/2005/04/09/406823.aspxand this one (not in english, but the code is useful)
Code sample from: http://web.archive.org/web/20100703052446/http://blogs.msdn.com/b/psheill/archive/2005/04/09/406823.aspx
It generates output like the following, when the keys and values are strings.