public async Task <IActionResult> SearchReservation(SearchReservationViewModel srvm) { Reservation reservationToFind = null; if (!ModelState.IsValid) { return(View(srvm)); } var reservationOwner = await _userManager.FindByEmailAsync(srvm.Email); if (reservationOwner != null) { reservationToFind = _reservationRepository.FindReservationByUser(srvm.ConfirmationNumber, reservationOwner); } if (reservationOwner == null || reservationToFind == null) { ModelState.AddModelError(string.Empty, "Reservation Could not be Found"); return(View()); } return(RedirectToAction("UpdateCancelReservation", reservationToFind)); }