Пример #1
0
        public JobWithContent LoadWithContent(int id)
        {
            _tracer.TraceEvent(TraceEventType.Start, 0);
            var contentRepository = new PageContentRepository(this._settings);

            using (contentRepository.AcquireLock(id))
            {
                Job job;
                using (var context = new CoreContext())
                {
                    var repository = new JobRepository(context);
                    job = repository.Load(id);
                }

                PageContent referenceContent = null;
                if (job.HasReferenceScraped)
                {
                    referenceContent = contentRepository.LoadReferenceContent(job.ID);
                }

                PageContent testContent = null;
                if (job.HasTestScraped)
                {
                    testContent = contentRepository.LoadTestContent(job.ID);
                }

                _tracer.TraceEvent(TraceEventType.Stop, 0);

                return(new JobWithContent(job, referenceContent, testContent));
            }
        }