/// <summary> /// Compares two opening times for equality. /// </summary> /// <param name="OpeningTimes">An opening time to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(OpeningTime OpeningTimes) => Periods.Count().Equals(OpeningTimes.Periods.Count()) && Periods.All(period => OpeningTimes.Periods.Contains(period)) && On.Equals(OpeningTimes.On) && ((!UnstructuredText.IsNullOrEmpty() && !OpeningTimes.UnstructuredText.IsNullOrEmpty()) || (UnstructuredText.IsNullOrEmpty() && OpeningTimes.UnstructuredText.IsNullOrEmpty() && UnstructuredText.Equals(OpeningTimes.UnstructuredText)));