title: How do I filter with OData based on an inner array?
body: <p>So I created a controller using the mvc4 web api where the url  (Get)  “/api/things” return the following data:</p>
  
  <pre><code> &lt;ArrayOfThing&gt;
     &lt;Thing&gt;
     &lt;Id&gt;1&lt;/Id&gt;
     &lt;Description&gt;The Thing Desc&lt;/Description&gt;
     &lt;Categories&gt;
             &lt;Category&gt;&lt;Id&gt;1&lt;/Id&gt;&lt;/Category&gt;
            &lt;Category&gt;&lt;Id&gt;2&lt;/Id&gt;&lt;/Category&gt;
     &lt;/Categories&gt;
    &lt;/Thing&gt;
    &lt;Thing&gt;
     &lt;Id&gt;2&lt;/Id&gt;
     &lt;Description&gt;The Other Thing Desc&lt;/Description&gt;
     &lt;Categories&gt;
             &lt;Category&gt;&lt;Id&gt;1&lt;/Id&gt;&lt;/Category&gt;
             &lt;Category&gt;&lt;Id&gt;3&lt;/Id&gt;&lt;/Category&gt;
     &lt;/Categories&gt;
    &lt;/Thing&gt;
  &lt;/ArrayOfThing&gt;
  </code></pre>
  
  <p>*note that thing and categories has a many to many relationship</p>
  
  <p>I know that if a need one “Thing” resource I should use a controller that matches the following route url  (Get)  “/api/things/{id}”.  </p>
  
  <p>But what if I want to get a subset of the data returned by the url  (Get)  “/api/things”.  I tested the OData protocol modifying the controller to return an IQueryable and it work fine if I wanted to $filter on the properties of “Thing” like the Id or the Description.  Unfortunately, I didn’t work out when I wanted to filter base on the Category, I believe is because Categories is an inner array.</p>
  
  <p>So, what should I do to filter based on categories? </p>