public void Handle(SetApprovalStatusCreatedEvent message) { var requestId = message.RequestId; var service = CalendarServiceByToken(_accessTokenService); var scheduleInfo = _schedulingRepository.ScheduleInfoByRequest(requestId); var evt = new Google.Apis.Calendar.v3.Data.Event { Summary = scheduleInfo.Description, Start = new EventDateTime() { DateTime = scheduleInfo.StartDate, TimeZone = "America/Sao_Paulo" } }; if (scheduleInfo.EndDate != DateTime.MinValue) { evt.End = new EventDateTime() { DateTime = scheduleInfo.EndDate, TimeZone = evt.Start.TimeZone } } ; var request = service.Events.Insert(evt, "primary"); var createdEvent = request.Execute(); var created = new ExternalProviderScheduleCreatedEvent(requestId, "Google", createdEvent.ICalUID); _bus.RaiseEvent(created); }