public IEnumerable <object> GetData(CrawlJobData jobData) { if (!(jobData is SQLCrawlJobData sqlcrawlJobData)) { yield break; } var client = clientFactory.CreateNew(sqlcrawlJobData); //retrieve data from provider and yield objects foreach (var item in client.Get(sqlcrawlJobData.ConnectionString, sqlcrawlJobData.TableName)) { 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 SQLCrawlJobData sqlCrawlJobData)) { throw new Exception("Wrong CrawlJobData type"); } var client = _sqlClientFactory.CreateNew(sqlCrawlJobData); return(await Task.FromResult(client.GetAccountInformation())); }