public async Task <IActionResult> Details(string AnswerCode, string CityName, string VacationName, int UserID) { SavedTrip trip = new SavedTrip { AnswerCode = AnswerCode, CityName = CityName, VacationName = VacationName, UserID = UserID, InUSA = (AnswerCode[0] == '1' ? true : false), LikesHot = (AnswerCode[2] == '1' ? true : false), HasChildren = (AnswerCode[6] == '1' ? true : false), LikesOutdoor = (AnswerCode[8] == '1' ? true : false) }; PopularTrip popTrip = new PopularTrip { AnswerCode = AnswerCode, CityName = CityName, VacationName = VacationName, Popularity = 0, InUSA = (AnswerCode[0] == '1' ? true : false), LikesHot = (AnswerCode[2] == '1' ? true : false), HasChildren = (AnswerCode[6] == '1' ? true : false), LikesOutdoor = (AnswerCode[8] == '1' ? true : false) }; switch (AnswerCode[4]) { case '1': trip.Price = 1; popTrip.Price = 1; break; case '2': trip.Price = 2; popTrip.Price = 2; break; case '3': trip.Price = 3; popTrip.Price = 3; break; } await _trips.SaveAsPopularTrip(popTrip); try { await _trips.SaveTrip(trip); } catch (Exception) { return(Ok("You already saved a vacation just like that! Try again.")); } return(RedirectToAction("MyVacations", UserID)); }