title: An exception of type 'System.NullReferenceException' occurred in App_Web_jwfiir5n.dll but was not handled in user code
body: <p>I am working on a Shopping cart application. It has already been developed by some developer. But i tried to rebuild it but i am getting the following exception </p>
  
  <p><strong>An exception of type 'System.NullReferenceException' occurred in App_Web_jwfiir5n.dll but was not handled in user code
  Additional information: Object reference not set to an instance of an object.</strong></p>
  
  <p>The Code in my View is below:</p>
  
  <pre><code> &lt;tbody&gt;
                  @foreach (var item in Model)
                  {
                      &lt;tr&gt;
                        &lt;td&gt;@(Model.IndexOf(item) + 1)&lt;/td&gt;
                        &lt;td&gt;&lt;a style="color:cornflowerblue" title="Click to see the product detail" href="/admin/ProductDetail?productId=@item.ProductId"&gt; @item.Tbl_Product.ProductName&lt;/a&gt;&lt;/td&gt;
                        &lt;td&gt;@(item.Tbl_Members.FirstName + " " + item.Tbl_Members.LastName)&lt;/td&gt;
                        &lt;td&gt;@item.Tbl_Members.EmailId&lt;/td&gt;
                      &lt;/tr&gt;
                  }
               &lt;/tbody&gt;
  </code></pre>
  
  <p>And The Controler side is below:</p>
  
  <pre><code> public ActionResult OrderDetail(int productId) 
  {
      List&lt;Tbl_Cart&gt; ProductOrders = _unitOfWork.GetRepositoryInstance&lt;Tbl_Cart&gt;().GetListByParameter(i =&gt; i.CartStatusId == 3 &amp;&amp; i.ProductId == productId).ToList(); 
      return View(ProductOrders); 
  } 
  </code></pre>
  
  <p>Can anyone help me with this error.</p>