none
Create XML from Generic T Object RRS feed

  • Question

  • Hi,

    I have to create xml from generic T object. Generic T object might have Dictionary in its properties so XMLSerialization will not work.

    T object looks like below:

    Class ABC{

    Dictionary<string,string[]> []ABCProperty

    }

    Can anyone help me how can I achieve this task?

    Thanks in advance,

    Prateek

    Friday, June 26, 2015 6:05 AM

Answers

  • hi Prateek,
       As per your case, I suggested you to refer the following links which may guide you to resolve this case:

    1. Click here to refer the sample code with explanation about XML Serializing a Hashtable or generic Dictionary.

    2. Click here to refer the sample code with explanation about XML Serialization of a Class Inherited from Generic List of type Interface.

    Monday, June 29, 2015 7:11 AM

All replies

  • I dont want this xml to be physically stored. I want to use it in code only
    Friday, June 26, 2015 6:07 AM
  • Posted in wrong forum...Sorry moving this question to C# forum.
    Friday, June 26, 2015 6:29 AM
  • hi Prateek,
       As per your case, I suggested you to refer the following links which may guide you to resolve this case:

    1. Click here to refer the sample code with explanation about XML Serializing a Hashtable or generic Dictionary.

    2. Click here to refer the sample code with explanation about XML Serialization of a Class Inherited from Generic List of type Interface.

    Monday, June 29, 2015 7:11 AM