title: Filter Child Property OData and ASPNET WebApi
body: <p>I'm facing a problem. I've googled a lot and searched in here too, but I couldn't find a answer to this problem.</p>
  
  <p>I have a <code>ASPNET Web Api</code> that returns <code>JSON</code>. I also, add <a href="http://www.nuget.org/packages/Microsoft.Data.OData/" rel="nofollow">Microsoft.Data.OData</a> nuget to allow odata queries.</p>
  
  <p>It's working fine for simple cases, but now, I need to apply a filter in a child collection.</p>
  
  <p>Sample:</p>
  
  <pre><code>{"total":1,"products":[{"id":20289,"brandId":5,"categoryId":1,"price":12.0,"name":"Carolina Herrera","description":"CH","productCode":"asd2334","picture":null,"contentPackaging":"liquid","brandName":"Carolina Herrera","brandPicture":null,"generic":true},
  {"id":20290,"brandId":5,"categoryId":1,"price":25.0,"name":"Carolina Herrera 2","description":"CH 2","productCode":"asd999","picture":null,"contentPackaging":"liquid","brandName":"Carolina Herrera","brandPicture":null,"generic":true}
  ]}
  </code></pre>
  
  <p>I want to query in products collection where price is greater than 20 for example.</p>
  
  <p>I've tried something like this:</p>
  
  <pre><code>http://domain.com/api/$filter=products/price gt 20
  </code></pre>
  
  <p>But that didn't work.</p>
  
  <p>Is it possible to do that?</p>
  
  <p>Code:</p>
  
  <pre><code>//controller
  public IQueryable&lt;ViewModelProducts&gt; GetProducts()
  {
      var products = _repository.FindBy(x=&gt;x.Generic &amp;&amp; x.Status).ToList();
  
      return products.Count == 0 ? new List&lt;ViewModelProducts&gt;().AsQueryable() : products.AsQueryable();
  }
  
  //model
  public class ViewModelProducts
  {
      public int total { get; set; }
      public IQueryable&lt;Products&gt; products { get; set; }
  }
  
  public class Products
  {
      public int id { get; set; }
      public int brandId { get; set; }
      public int categoryId { get; set; }
      public decimal price { get; set; }
      public string name { get; set; }
      public string description { get; set; }
      public string productCode { get; set; }
      public string picture { get; set; }
      public string contentPackaging { get; set; }
      public string brandName { get; set; }
      public string brandPicture { get; set; }
      public bool generic { get; set; }
  }
  </code></pre>