0down votefavorite | I've changed my approach and decided to start writing XML with Linq. I've readed some tutorials and was able to write with no problem. However , i don't know how to write elements iterating over my array of lists. I've a nested foreach: that i can use to access elements of my list. Since its an array of list , each position of the array is going to have a list with three elements from this class: However, if i directly write x.colorname into the Linq as an XAttribute , in the next iteration it'll overwrite its value and in the end the fill will have only the last element. i.e: When the foreach loop finishes iterating over this position, the XML File is going to have only the magenta written. And i would like to have all values written (since it'll iterate over all list positions). How can i achieve that ? Thanks in advance. |
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.