public IEnumerable <object> GetData(CrawlJobData jobData) { if (!(jobData is SkypeCrawlJobData skypecrawlJobData)) { yield break; } var client = clientFactory.CreateNew(skypecrawlJobData); //retrieve data from provider and yield objects foreach (var item in client.Get()) { yield return(item); } }
public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId) { if (jobData == null) { throw new ArgumentNullException(nameof(jobData)); } if (!(jobData is SkypeCrawlJobData skypeCrawlJobData)) { throw new Exception("Wrong CrawlJobData type"); } var client = _skypeClientFactory.CreateNew(skypeCrawlJobData); return(await Task.FromResult(client.GetAccountInformation())); }