The following Unit Test passes in VB.Net
<Test()> _
Public Sub VB_XMLLiteral_SyntaxRocks_Test()
Dim XML = <Doc>
<Level1>
<Item id="1"/>
<Item id="2"/>
</Level1>
<Level1>
<Item id="3"/>
<Item id="4"/>
</Level1>
</Doc>
Assert.AreEqual(4, XML.<Level1>.<Item>.Count)
End Sub
How do I assert the same thing in C#?
To clarify, I 'd like to know how to express...
XML.<Level1>.<Item>
...in C#
And of course
XML
needs to be anXElement
(that's what a VB literal produces too)