Ejemplo n.º 1
0
        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 TrinetCrawlJobData trinetCrawlJobData))
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _trinetClientFactory.CreateNew(trinetCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }
Ejemplo n.º 2
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            if (!(jobData is TrinetCrawlJobData trinetcrawlJobData))
            {
                yield break;
            }

            var client = clientFactory.CreateNew(trinetcrawlJobData);

            //retrieve data from provider and yield objects

            foreach (var employee in client.GetEmployee())
            {
                yield return(employee);
            }
        }