// GET: Toys public ActionResult Index() { if (Session["IsAdmin"] != null) { MongoDB db = new MongoDB(); var toys = db.GetAllToys(); Toys model = new Toys(); model.EntityList = toys.ToList(); return(View(model)); } else { return(RedirectToAction("Login", "Users")); } }