Click here to Skip to main content
16,019,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a collection and i want to write to xml file. can anyone help?
Posted
Updated 21-May-10 4:34am
v2

1 solution

If it's a collection of complex objects (versus simple intrinsic types), you could create a property that can returns the objects as XElements, or you could use XML serialization.

I personally prefer the property approach.

If they're not complex types, you could write extension method for the desired type that simply returns a XElement.

Isn't being as programmer fun?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900