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

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.

The Code in my View is below:

                @foreach (var item in Model)
                      <td>@(Model.IndexOf(item) + 1)</td>
                      <td><a style="color:cornflowerblue" title="Click to see the product detail" href="/admin/ProductDetail?productId=@item.ProductId"> @item.Tbl_Product.ProductName</a></td>
                      <td>@(item.Tbl_Members.FirstName + " " + item.Tbl_Members.LastName)</td>

And The Controler side is below:

 public ActionResult OrderDetail(int productId) 
    List<Tbl_Cart> ProductOrders = _unitOfWork.GetRepositoryInstance<Tbl_Cart>().GetListByParameter(i => i.CartStatusId == 3 && i.ProductId == productId).ToList(); 
    return View(ProductOrders); 

Can anyone help me with this error.

Related posts

Recent Viewed