public IActionResult Edit(Hotel model) { if (HttpContext.Session.GetString("ID") == null) { return(RedirectToAction("Login", "Admin")); } else { //check validation if (ModelState.IsValid) { hotelRepository.Edit(model); return(RedirectToAction("Index")); } //forward city list ViewBag.listAllCities = hotelRepository.listAllCities(); return(View(model)); } }