public ActionResult UpdateInfo(long? id) { GrubDBDataContext GrubDB = new GrubDBDataContext(); if (id == null) { //check if there are multiple restaurants associated with account, if so display list var associatedComps = GrubDB.selectall_company_info().Where(m => m.username == User.Identity.Name.Replace("@rose-hulman.edu","")).ToList(); if(associatedComps.Count>1) { Session["restaurants"] = associatedComps; return RedirectToAction("RestaurantList"); } if(associatedComps.Count!=1) { return RedirectToAction("CreateRestaurant"); } //otherwise show the restaurant associated with the account id = associatedComps[0].id; } var model = GrubDB.selectall_with_id_company_info(id).ToList()[0]; return View(convert(model)); }