title: OData with multiple keys
body: <p>I'm using the Microsoft.OData 6.11.0 package, and I'd like to be able to allow users of the API to use one of three properties (DB primary key, username, or external ID number) as the key for a data type representing people. The formats for the properties are different enough that they can be distinguished between easily. I set up the OData model as follows:</p>
  
  <pre><code>ODataModelBuilder builder = new ODataConventionModelBuilder();
  builder.EntitySet&lt;Person&gt;("Person");
  config.MapODataServiceRoute(
      routeName: "ODataRoute",
      routePrefix: "OData",
      model: builder.GetEdmModel());
  </code></pre>
  
  <p>In the controller, I have:</p>
  
  <pre><code>[EnableQuery]
  public SingleResult&lt;Person&gt; Get([FromODataUri] String key) {/*...*/}
  
  [EnableQuery(PageSize = 100)]
  public IQueryable&lt;Widget&gt; WidgetsFromPerson([FromODataUri] String key) {/*...*/}
  </code></pre>
  
  <p>which takes a guess at which identifier is provided and returns the appropriate data. These work:</p>
  
  <pre><code>GET http://localhost/app/OData/Person(1234)
  GET http://localhost/app/OData/Person(999999999)
  GET http://localhost/app/OData/Person(1234)/Widgets
  GET http://localhost/app/OData/Person(999999999)/Widgets
  </code></pre>
  
  <p>These get me a 404.</p>
  
  <pre><code>GET http://localhost/app/OData/Person('username')
  GET http://localhost/app/OData/Person('username')/Widgets
  </code></pre>
  
  <p>If I can't do this, is there an alternate syntax I can use to get the person by username as well as the widgets for that person by username?</p>
  
  <p>The metadata returned through the API includes this:</p>
  
  <pre><code>&lt;edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"&gt;
    &lt;edmx:DataServices&gt;
      &lt;Schema Namespace="MyModel" xmlns="http://docs.oasis-open.org/odata/ns/edm"&gt;
        &lt;EntityType Name="AbstractPerson" Abstract="true"&gt;
          &lt;Key&gt;
            &lt;PropertyRef Name="PersonId" /&gt;
          &lt;/Key&gt;
          &lt;Property Name="PersonId" Type="Edm.Int32" Nullable="false" /&gt;
        &lt;/EntityType&gt;
        &lt;EntityType Name="Person" BaseType="MyModel.Person"&gt;
          &lt;Property Name="UserName" Type="Edm.String" /&gt;
          &lt;NavigationProperty Name="Widgets" Type="Collection(MyModel.Widget)" /&gt;
        &lt;/EntityType&gt;
      &lt;/Schema&gt;
    &lt;/edmx:DataServices&gt;
  &lt;/edmx:Edmx&gt;
  </code></pre>
  
  <p>Thanks!</p>