public virtual DailySchedule SetTimeOfDay(string time) { DayTime dt; if (!DayTime.TryParse(time, out dt)) { throw new ArgumentException("Invalid time format", nameof(time)); } dayTime = dt; return(this); }