<Page>
<NTrans>
<Testing testsequence = 1 skew = 3 />
</Testing>
</NTrans>
</Page>
I want to pull the testsequence and skew using a a var in c#. How would I go about this? Right now I have:
var _img = xDoc.Element("Page").Descendants("Testing").Attributes("testsequence").ToList();
Which does not work. It says IEnumerable does not contain a definition for ToList
The
ToList()method is an Extension method of IEnumerable. Extension methods were introduced in C# 3.0, so if your tags are correct and you are using C# 3.0, this should be fine.You may need to import the namespace that contains the
ToListextension method.Put this code with the rest of your
usingstatements at the top of your code file: