Right now, I'm reading an XML document and pass its main elements to the method below. This method then returns the relevant elements in a IEnumerable, which is used to update a DataGridView.
private IEnumerable<object> readRelease(IEnumerable<XElement> release)
{
return (
from r in release
select new
{
Release = r.Attribute("id").Value
//etc.
});
}
For the DataGridView, this method works well, but what if I want to write these elements to an XML file or, more broadly, just want to access a particular variable (e.g. "Release"). Can I then still use this method or should I go for something else?