title: Web API 2: OData 4: Actions returning 404
body: <p>I have an <code>OData v4</code> action method which is not working; note however that it was working fine in <code>OData v3</code> (I am obviously in the process of trying to update my project)</p>
  
  <p><strong>OData Action Method:</strong></p>
  
  <pre><code>[HttpPost]
  public Translation Translate(ODataActionParameters parameters)
  {
      // Implementation
  }
  </code></pre>
  
  <p><strong>Configuration:</strong></p>
  
  <pre><code>ODataModelBuilder builder = new ODataConventionModelBuilder();
  builder.EntitySet&lt;Page&gt;("Pages");
  //etc (Other Entity Sets)
  
  var pageEntityType = builder.EntityType&lt;Page&gt;();
  var translateAction = pageEntityType.Collection.Action("Translate");
  translateAction.Parameter&lt;Guid&gt;("pageId");
  translateAction.Parameter&lt;string&gt;("cultureCode");
  translateAction.Returns&lt;Translation&gt;();
  
  //etc (Other Actions)
  
  var route = config.MapODataServiceRoute("OData_CMS", "odata/cms", builder.GetEdmModel());
  </code></pre>
  
  <p><strong>Client AJAX Call:</strong></p>
  
  <pre><code>var data = {
      pageId: $("#CultureSelector_PageId").val(),
      cultureCode: $("#CultureSelector_CultureCode").val()
  };
  
  $.ajax({
      url: "/odata/cms/Pages/Translate",
      type: "POST",
      contentType: "application/json; charset=utf-8",
      data: JSON.stringify(data),
      dataType: "json",
      async: false
  })
  .done(function (json) {
      //etc
  </code></pre>
  
  <p>I tried to see if anything has changed regarding setup for OData actions in version 4, but it seems the same (refer to: <a href="http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/odata-actions-and-functions" rel="nofollow">Actions and Functions in OData v4 Using ASP.NET Web API 2.2</a>)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I found out that <code>OData v4</code> uses a <code>Default</code> namespace and implemented that, as follows:</p>
  
  <p>Firstly, just by changing my AJAX call to:</p>
  
  <p><code>url: "/odata/cms/Pages/Default.Translate",</code></p>
  
  <p>That didn't work, so I also added:</p>
  
  <p><code>[ODataRoute("Default.Translate")]</code> and</p>
  
  <p><code>[EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All)]</code></p>
  
  <p>to my action, as per the instructions at this link: <a href="http://damienbod.wordpress.com/2014/06/16/web-api-and-odata-v4-crud-and-actions-part-3/" rel="nofollow">http://damienbod.wordpress.com/2014/06/16/web-api-and-odata-v4-crud-and-actions-part-3/</a>..</p>
  
  <p>Also not working.. I have followed the steps to the letter... either I'm being blind and missing something here or there's a serious problem with the latest version of <code>OData</code> for <code>Web API</code>.</p>