title: How can i pass an object (Entity) as a parameter on WebApi Odata
body: <p>i follow this link <a href="http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-actions" rel="nofollow">Supporting OData Actions in ASP.NET Web API</a>
  And i want to pass my object/Entity as a parameter like this:</p>
  
  <pre><code>ActionConfiguration addNewPatient = builder.Entity&lt;Patient&gt;().Collection.Action("AddNewPatient");
          addNewPatient.Parameter&lt;int&gt;("hospId");
          addNewPatient.Parameter&lt;int&gt;("docId");
          addNewPatient.Parameter&lt;Patient&gt;("patient");
          addNewPatient.Returns&lt;bool&gt;();
  </code></pre>
  
  <p>but i got this issue:</p>
  
  <pre><code>System.ArgumentException: Invalid parameter type 'Patient'. 
  A non-binding parameter type must be either Primitive, Complex, Collection of Primitive or a Collection of Complex.
  Parameter name: parameterType
  </code></pre>
  
  <p>I tried to implement this</p>
  
  <pre><code>   ActionConfiguration addNewPatient = builder.Entity&lt;Patient&gt;().Collection.Action("AddNewPatient");
      addNewPatient.Parameter&lt;int&gt;("hospId");
      addNewPatient.Parameter&lt;int&gt;("docId");
      var patientConfig = builder.StructuralTypes.OfType&lt;EntityTypeConfiguration&gt;().Single(x =&gt; x.Name == "Patient");
      addNewPatient.SetBindingParameter("patient", patientConfig, false);
      addNewPatient.Returns&lt;bool&gt;();
  </code></pre>
  
  <p>but i can't call method POST ../odata/Patient/AddNewPatient anymore</p>
  
  <pre><code>&lt;FunctionImport Name="AddNewPatient" ReturnType="Edm.Boolean"      IsBindable="true"&gt;
  &lt;Parameter Name="patient" Type="Patient"/&gt;
  &lt;Parameter Name="hospId" Type="Edm.Int32" Nullable="false"/&gt;
  &lt;Parameter Name="docId" Type="Edm.Int32" Nullable="false"/&gt;
  &lt;/FunctionImport&gt;
  </code></pre>
  
  <p>Please help me, i tried various way but still no luck.
  Thanks.</p>