title: Use generic include function in ASP.NET Core
body: <p>I have this generic include in ASP.NET Core:</p>
  
  <pre><code> public IQueryable&lt;T&gt; AllIncluding(params Expression&lt;Func&lt;T, object&gt;&gt;[] includeProperties)
   {
       IQueryable&lt;T&gt; query = _uow.Set&lt;T&gt;();
  
       return includeProperties.Aggregate(query, (current, includeProperty) =&gt; current.Include(includeProperty));
   }
  </code></pre>
  
  <p>I have two tables:</p>
  
  <pre><code>public class Brand
  {
      public int BrandId { get; set; }
      public string BFaName { get; set; }
      public string BEnName { get; set; }
      public int CatId { get; set; }
      public virtual ICollection&lt;Category&gt; Categories { get; set; }
      public virtual ICollection&lt;ProductBrand&gt; ProductBrands { get; set; }
  }
  
  public class ProductBrand
  {
      public int Id { get; set; }
      public virtual Brand Brand { get; set; }
      public virtual Product Product { get; set; }
  }
  </code></pre>
  
  <p>I need to find <code>BrandId</code> from <code>Brand</code> table by <code>ProductID</code> in <code>Product</code>.</p>
  
  <p>How can I use this generic include to find the <code>BrandID</code>? What should I pass to this generic include?</p>