public IEnumerable <object> GetData(CrawlJobData jobData) { if (!(jobData is DMSCrawlJobData dmscrawlJobData)) { yield break; } var client = clientFactory.CreateNew(dmscrawlJobData); //retrieve data from provider and yield objects }
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 DMSCrawlJobData dmsCrawlJobData)) { throw new Exception("Wrong CrawlJobData type"); } var client = _dmsClientFactory.CreateNew(dmsCrawlJobData); return(await Task.FromResult(client.GetAccountInformation())); }