public static bool Exist(IPeriod period, IEnumerable <IPeriod> periods, DateComparison dateComparison) { return(periods.Any(p => p != period && p.StartDate.CompareTo(period.StartDate) == (int)dateComparison)); }
public static bool DoesSpeakerHaveOtherSessions(Speaker speaker, Session currentSession, DateComparison when) { return(speaker.Sessions.Any( s => s.Id != currentSession.Id && s.ScheduledAt.CompareTo(currentSession.ScheduledAt) == (int)when )); }