Ejemplo n.º 1
0
        public Task CreateTaskFor(Job job, Action<Task> initialize = null) {
            Logger.Debug("CreateTaskFor() invoked for job with record ID {0}.", job.Record.Id);

            var task = Activate(new TaskRecord {
                Job = job.Record
            });

            if (initialize != null)
                initialize(task);

            job.Record.Tasks.Add(task.Record);
            _taskRepository.Create(task.Record);
            Logger.Information("Task was created for job with record ID {0}.", job.Record.Id);
            
            return task;
       }
Ejemplo n.º 2
0
        private Job Activate(JobRecord record) {
            if (record == null)
                return null;

            var job = new Job(record);
            job._tasksField.Loader(() => record.Tasks.Select(Activate));
            job._cloudVideoPartField.Loader(() => _contentManager.Get<CloudVideoPart>(record.CloudVideoPartId, VersionOptions.Latest));
            return job;
        }