private async Task <List <Appointment> > GetEqualAppointments(GoogleCalendarService googleCalenderService, OutlookCalendarService outlookCalendarService, string calenderId) { List <Appointment> googleAppointments = await googleCalenderService.GetCalendarEventsInRangeAsync(0, 2, calenderId); List <Appointment> outLookAppointments = await outlookCalendarService.GetOutlookAppointmentsAsync(0, 2); return((from lookAppointment in outLookAppointments let isAvailable = googleAppointments.Any(appointment => appointment.Equals(lookAppointment)) where isAvailable select lookAppointment).ToList()); }
private void ContinuationActionGoogle(Task <List <Calendar> > task, GoogleCalendarService googleCalenderService, TaskScheduler taskScheduler) { string calenderId = string.Empty; var calender = task.Result.FirstOrDefault(calendar => calendar.Name.Contains("Test")); if (calender != null) { calenderId = calender.Id; } googleCalenderService.GetCalendarEventsInRangeAsync(0, 1, calenderId) .ContinueWith(ContinuationActionGoogleAppointments, taskScheduler); }