public ActionResult AddRoom(Room room, string name, int id) { if (name == "Hotel") { repository.AddRoomToHotel(room, id); return(RedirectToAction("EditHotel", new { id = id })); } else if (name == "Resort") { repository.AddRoomToResort(room, id); return(RedirectToAction("EditResort", new { id = id })); } return(View("Error")); }