XML to IEnumerable

后端 未结 3 576
旧时难觅i
旧时难觅i 2021-02-09 15:42

Is there a way to Take a given XML file and convert (preferably using C# Generics) it into a Concrete Ienumerable list of T where T is my concrete class

So for example

3条回答
  •  遇见更好的自我
    2021-02-09 16:07

    I'm not sure I fully understand your circumstances, but one approach is to define a data transfer class and make it serializable in XML. Then you can deserialze the XML into an array of objects.

    edit

    I'm not going to delete this, but I think that what Andrew Hare posted is closer to what you want, and I've up-voted him in support.

提交回复
热议问题