public int CompareTo(object otherObj) { if (!(otherObj is ElectionPhaseForm otherForm)) { throw new Exception("Cannot compare ElectionPhaseForm with other types"); } return(BeginsAt.CompareTo(otherForm.EndsAt)); }
public bool ContainsDate(DateTime date) { return(date >= BeginsAt && date < BeginsAt.AddDays(Length)); }