My Input
<A xmlns="http://abc.com">
<B>"b"</B>
<C>"c"</C>
</A>
My Code
XNamespace ns = XNamespace.Get("http://abc.com");
var query= from node in doc.Descendants(ns+ "A")
select new
(
B = (string)node.Element(ns+"B"),
C = (string)node.Element(ns+ "C")
);
My Question
Do I have to add ns
every time I am doing node.Element()
? or is there any other way?