1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Serialize a Dictionary

Discussion in 'C#' started by PierlucSS, Sep 8, 2010.

  1. PierlucSS

    PierlucSS New Member

    Joined:
    Sep 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have been able to serialize an ienumerable this way
    Code:
                [XmlArray("TRANSACTIONS")]
                [XmlArrayItem("TRANSACTION", typeof(Record))]
                public IEnumerable Records
                {
                        get 
                        {
                                foreach(Record br in _budget)
                                {
                                        yield return br;
                                }
                        }
                }
    
    However, I realised that now I need a dictionnary containing a collection (Dictionary (Record collection implements ienumerable)))?

    how can i achieve that?

    Thank you
     

Share This Page