intersectingAppointmentItems = appointmentItems.Select(c => c as object)
.Where(c => (c.StartDate <= item.StartDate && (c.EndDate >= item.EndDate || c.EndDate > item.StartDate)) ||
(item.StartDate <= c.StartDate && (item.EndDate >= c.EndDate || item.EndDate > c.StartDate)))&&
(c => (c.StartTime <= item.StartTime && (c.EndTime >= item.EndTime || c.Time > item.StartTime)) ||
(item.StartTime <= c.StartTime && (item.EndTime >= c.EndTime || item.EndTime > c.StartTime)));
.Where(c => (c.StartDate <= item.StartDate && (c.EndDate >= item.EndDate || c.EndDate > item.StartDate)) ||
(item.StartDate <= c.StartDate && (item.EndDate >= c.EndDate || item.EndDate > c.StartDate)))&&
(c => (c.StartTime <= item.StartTime && (c.EndTime >= item.EndTime || c.Time > item.StartTime)) ||
(item.StartTime <= c.StartTime && (item.EndTime >= c.EndTime || item.EndTime > c.StartTime)));