public IEnumerable <object> GetData(CrawlJobData jobData) { if (!(jobData is NavisionCrawlJobData navisioncrawlJobData)) { yield break; } var client = clientFactory.CreateNew(navisioncrawlJobData); //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 NavisionCrawlJobData navisionCrawlJobData)) { throw new Exception("Wrong CrawlJobData type"); } var client = _navisionClientFactory.CreateNew(navisionCrawlJobData); return(await Task.FromResult(client.GetAccountInformation())); }