title: How to change OData root service uri
body: <p>I have an OData service. The base root uri is: <a href="http://example.com/odata/v1" rel="nofollow">http://example.com/odata/v1</a>.
  I expose it through another site: <a href="http://apigee.com/odata/v1" rel="nofollow">http://apigee.com/odata/v1</a>. This site redirects all requests to example.com and has client verification mechanism.</p>
  
  <p>I am using the OData .NET client library to call the service. Every simple request works fine:</p>
  
  <pre><code>GET http://apigee.com/odata/v1/Activities(1)
  GET http://apigee.com/odata/v1/AppPackages(1)
  </code></pre>
  
  <p>The corresponding .NET code is like this:</p>
  
  <pre><code>var container = new Container("http://apigee.com/odata/v1");
  var activity = container.Activities.Where(p =&gt; p.id == "1").SingleOrDefault();
  var apppackage = container.AppPackages.Where(p =&gt; p.id == "1").SingleOrDefault();
  </code></pre>
  
  <p>When I want to add link between these two entities, I run into "Unauthorization" problem. The code is:</p>
  
  <pre><code> container.AddLink(act, "AppPackages", package);
   container.SaveChanges();
  </code></pre>
  
  <p>And the generated http request is:</p>
  
  <pre><code>POST http://example.com/odata/v1/Activities(1)/$links/AppPackages 
  </code></pre>
  
  <p>The AddLink calls directly on "<a href="http://example.com/odata/v1" rel="nofollow">http://example.com/odata/v1</a>" instead of "<a href="http://apigee.com/odata/v1" rel="nofollow">http://apigee.com/odata/v1</a>". It does not pass through the client verification on apigee.com so example.com rejects it. I guess the reason is from the "odata.metadata". When I do</p>
  
  <pre><code>GET http://mysite.io/odata/v1/Activities(1)
  </code></pre>
  
  <p>The returned info is:</p>
  
  <pre><code>{
     "odata.metadata":"http://example.com/odata/v1/$metadata#Activities/@Element",
     ...
  }
  </code></pre>
  
  <p>I wonder if there is a way for me to return "<a href="http://apigee.com/odata/v1" rel="nofollow">http://apigee.com/odata/v1</a>" here. Or any way that can fix this problem. Thanks a lot.</p>