小编Bur*_*nzy的帖子

如何XML序列化字典

我已经能够以这种方式序列化IEnumerable:

[XmlArray("TRANSACTIONS")]
[XmlArrayItem("TRANSACTION", typeof(Record))]
public IEnumerable<BudgetRecord> Records
{
    get 
    {
        foreach(Record br in _budget)
        {
            yield return br;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,我意识到现在我需要一个包含集合的字典Dictionary<string, RecordCollection>(RecordCollection实现IEnumerable).

我怎样才能做到这一点?

.net c# xml-serialization xmlserializer

20
推荐指数
4
解决办法
6万
查看次数

标签 统计

.net ×1

c# ×1

xml-serialization ×1

xmlserializer ×1