public async Task DeleteIntegrationAsync(string id) { Integration integration = await _integrationRepository.GetIntegrationAsync(id, _operationContext.UserId); if (integration != null) { IIntegrationSystemService integrationSystemService = _integrationSystemServices.GetService(integration.Provider); await integrationSystemService.DeleteIntegrationAsync(_operationContext.UserId); await _integrationRepository.DeleteIntegrationAsync(id, _operationContext.UserId); await _eventPublisher.PublishAsync(CreateIntegrationDeletedEvent(integration)); } }