title: $Metadata with WebAPi OData Attribute Routing Not Working
body: <p>I'm using OData Attribute Routing for an OData endpoint.  Here is an example of what I have:</p>
  
  <pre><code>[ODataRoutePrefix("Profile")]
  public class ProfileODataController : ODataController
  {
      [ODataRoute]
      [EnableQuery]
      public IHttpActionResult Get()
      {
          var repo = new Repositories.ProfileRepository();
  
          return Ok(repo.GetProfiles());
      }
  
      [ODataRoute("({key})")]
      [EnableQuery]
      public IHttpActionResult Get([FromODataUri] string key)
      {
          var repo = new Repositories.ProfileRepository();
  
          var result = repo.GetProfiles().SingleOrDefault(x =&gt; x.Id== key);
          if (result == null) return NotFound();
  
          return Ok(result);
      }
  }
  </code></pre>
  
  <p>Here is my set up:</p>
  
  <pre><code>config.MapODataServiceRoute("odata", "odata", ModelGenerator.GetEdmModel());
  </code></pre>
  
  <p>Here is my EdmModel Generation:</p>
  
  <pre><code>public static IEdmModel GenerateEdmModel()
  {
      var builder = new ODataConventionModelBuilder();
  
      builder.EntitySet&lt;Profile&gt;("Profile").EntityType.HasKey(x =&gt; x.Id);
  
      return builder.GetEdmModel();
  }
  </code></pre>
  
  <p>The urls  <code>/odata/Profile</code> and <code>/odata/Profile('someid')</code> both work, but when I try to access the $metadata endpoint (<code>/odata/$metadata#Profile</code>), I get the following error:</p>
  
  <blockquote>
    <p>{"Message":"No HTTP resource was found that matches the request URI 'http://<strong>****</strong>/odata/$metadata'.","MessageDetail":"No type was found that matches the controller named 'Metadata'."}</p>
  </blockquote>
  
  <p>Do I need to create a <strong>controller/action</strong> for serving the metadata?  If so, how is that action implemented?</p>