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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice