title: Cant load product that have sub group
body: <p>I'm try to show single group by id, sub groups that have that group id as parent id and product that have group id or parent id.</p>
  
  <p>code of service:</p>
  
  <pre><code>    public List&lt;CompanyProductGroup&gt; GetPorductGroupById(int id)
      {
  
          return _context.CompanyProductGroups
               .Where(c =&gt; c.CompanyProductGroupId == id &amp;&amp; c.IsDelete != true || c.ParentId == id).ToList();
      }
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>    [Route("group/{title}/{id}")]
      public IActionResult Group(string title, int id)
      {
          ViewBag.PageId = id;
          return View(_companyService.GetPorductGroupById(id));
      }
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>@foreach (var prod in Model.Where(p =&gt; p.ParentId == ViewBag.PageId)){
      &lt;section style="height:150vh" class="has-shadow section2"&gt;
          &lt;div class="white"&gt;&lt;/div&gt;
          &lt;div class="pgHeader"&gt;
              &lt;div class="headwrap"&gt;
                  &lt;div class="right-side"&gt;
                      &lt;p&gt;
                          @prod.CompanyProductGroupDes
                      &lt;/p&gt;
                  &lt;/div&gt;
                  &lt;div class="center-side"&gt;
                      &lt;div class="center-side-inner"&gt;&lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="left-side"&gt;
                      &lt;img src="~/CompanyProductGroup/image/@prod.CompanyProductGroupPic" alt="@prod.CompanyProductGroupTitle" /&gt;
  
                  &lt;/div&gt;
  
              &lt;/div&gt;
  
          &lt;/div&gt;
          &lt;div class="clearfix"&gt;&lt;/div&gt;
  
          &lt;div class="wid-box"&gt;
  
  
              @if (prod.CompanyProduct != null)
              {
                  @foreach (var gr in prod.CompanyProduct.Where(c =&gt; c.SubGroupId == prod.CompanyProductGroupId))
                  {
                      &lt;div class="wid-50"&gt;
                          &lt;img src="~/Content/img/tires.png" /&gt;
                          &lt;div class="wid-50-content"&gt;
                              &lt;h2&gt;Prod Title&lt;/h2&gt;
                              &lt;p&gt;
                                  لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافرا برای طراحان رایانهای .
                              &lt;/p&gt;
                              &lt;a href="#"&gt;بیشتر&lt;/a&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  }
              }
          &lt;/div&gt;
  
  
  
      &lt;/section&gt;
  </code></pre>
  
  <p>}</p>
  
  <p>I have error on inner foreach, that show me :
  ArgumentNullException: Value cannot be null.
  Parameter name: source
  System.Linq.Enumerable.Where(IEnumerable source, Func predicate)</p>
  
  <p>But I have data in my table. please help me to solve this problem. Thanks in advance</p>