views:

771

answers:

2

Reading an article called "Increase LINQ Query Performance" in Jully's MSDN magazine, the author states that using an Imports in VB providing a path to schema in the current project will turn IntelliSense on for XElement. In the code provided, he uses statements like xelement.@name to retreive attributes values, and so on.

I did not try this out myself in VB, but I would like to use that in C#. This really looks like Linq to Xsd.

Is there any equivalent in C#? It seems that it is not possible to use a namespace inside C# code, there is no using equivalent to this Import statement.

+1  A: 

This post claims to have a link to a video that shows how to use VB9's XML Literals in C#. However, it only really discusses them and from what I can gather, you cannot use them in C#. http://blogs.msdn.com/bethmassi/archive/2008/07/03/teched-panel-vb-xml-literals-for-c-developers.aspx

John Sheehan
That video isn't claiming to show how to use XML Literals in C#. It's explaining their use in VB9 so that non-vb developers can understand them.
Dennis Palmer
A: 

I don't want to see any XML Literals in my C# code.

The SQL-like syntax of Linq statements is ok because it makes my code more readable.

FantaMango77