Here is the example from MSDN for XNamespace:
XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root", "Content");
Console.WriteLine(root);
I am not sure what is happening in the first line. Is there some kind of implicit conversion going on?
XNamespacehas a staticGetmethod that accepts a string parameter and returns anXNamespaceinstance. So you could rewrite the line asIn the version you posted, you would be taking advantage of an implicit conversion defined against string. Presumably, the implementation thereof simply invokes the aforementioned method. An example of a possible implementation: