// GET: HOME PAGE FOR VENDOR public ActionResult VendorIndex() { UserLoginModel user = (UserLoginModel)HttpContext.Session["USER"]; //VENDOR ROLE_ID IS 2 if (user == null || user.RoleId != 2) { return(RedirectToAction("Index", "Home")); } int vendorId = user.Id; IEnumerable <ProductModel> productList = null; try { productList = productActionContext.GetProductsByVendorId(vendorId); } catch (Exception e) { //LOG EXCEPTION logger.Error("Product List of Vendor is not loaded by VendorIndex() of User Controller : ", e); } return(View(productList)); }