Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:29:55+00:00 2026-05-24T23:29:55+00:00

Here is the example from MSDN for XNamespace: XNamespace aw = http://www.adventure-works.com; XElement root

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:29:55+00:00Added an answer on May 24, 2026 at 11:29 pm

    XNamespace has a static Get method that accepts a string parameter and returns an XNamespace instance. So you could rewrite the line as

    XNamespace aw = XNamespace.Get("http://www.adventure-works.com");
    

    In 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:

    public static implicit operator XNamespace(string name)
    {
        return Get(name);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base
I'm trying to compile the example from here; http://msdn.microsoft.com/en-us/library/ms682619(VS.85).aspx I've installed the Platform SDK,
I am trying to follow this example from MSDN: http://msdn.microsoft.com/en-us/library/a1hetckb.aspx I think i'm doing
I took the code from this example. http://msdn.microsoft.com/en-us/library/2tw134k3.aspx What I am wondering (and I've
Here is an example of using a SqlUserDefinedAggregate : http://msdn.microsoft.com/en-us/library/91e6taax(v=vs.80).aspx Which allows you to
I see an example from the website http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser%28v=VS.90%29.aspx Here they are using a statement
Going from the example given here... http://ericswann.org/blog/archive/2009/04/06/linq-to-sql-datacontext-provider-revisited.aspx I'm trying to use the datacontext between
I'm trying to learn how from this site http://msdn.microsoft.com/en-us/library/cc265158(v=vs.95).aspx but the code won't compile
This following code example is borrowed from MSDN here . I am not getting
I'm modifying demo application from this article: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx I need to update all files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.