private static void EnterStartDate() { bool startDateTimeIsValid = false; while (!startDateTimeIsValid) { ConsolePrinter.PrintEnterStartDate(); string strStartDateTime = Console.ReadLine(); if (string.IsNullOrWhiteSpace(strStartDateTime)) { startDateTimeIsValid = true; lastSearchCriteria.StartDateTime = null; break; } if (DateTimeHelper.TryParseDateTime(strStartDateTime, out DateTime dateTime)) { startDateTimeIsValid = true; lastSearchCriteria.StartDateTime = dateTime; } else { ConsolePrinter.PrintInvalidStartDate(); } } }