title: Dynamic Namespace Switching
body: <p>I'm attempting to put a web service wrapper around several third-party web services. For the sake of this question, we'll work with two of them:</p>
  
  <ol>
  <li>OrderService</li>
  <li>AddressService</li>
  </ol>
  
  <p>Both of these services have the same object defined in different namespaces:</p>
  
  <ol>
  <li>OrderService.AuthenticationParameters</li>
  <li>AddressService.AuthenticationParameters</li>
  </ol>
  
  <p>I was hoping to be able to create a single base class that would be able to detect/switch between namespaces. For example:</p>
  
  <pre><code>public abstract class BaseLogic
  {
      internal BaseLogic()
      {
          /* Initialize authParams */
  
          //Switch out / detect namespace here
          this.authParams = new OrderService.AuthenticationParameters();
          this.authParams.accountName = "[MyAccountName]";
          this.authParams.userName = "[MyUserName]";
          this.authParams.password = "[MyPassword]";
      }
  }
  </code></pre>
  
  <p>I've seen several similar questions. Either they don't apply to my situation, or I'm incapable of understanding them.</p>
  
  <p><strong>Question:</strong> Is what I'm trying to achieve possible? If it's possible, am I over complicating things?</p>
  
  <p><strong>Additional Info:</strong> Eventally, there will be more than two services that share this common object. The vendor provides a separate service URL for each branch of functionality they provide.</p>