internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository, string pollingQueue) { ITaskRuntimeInfo result = repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, pollingQueue); repository.Add(result); return(result); }
internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository, TaskPriority priority) { ITaskRuntimeInfo result = repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, priority, null); repository.Add(result); return(result); }
internal static ITaskRuntimeInfo Add(this ITaskRuntimeInfoRepository repository) { ITaskRuntimeInfo result = repository.Create(); repository.Add(result); return(result); }
internal static TTaskRuntimeInfo Add <TTaskRuntimeInfo>(this ITaskRuntimeInfoRepository repository) where TTaskRuntimeInfo : ITaskRuntimeInfo { TTaskRuntimeInfo result = repository.Create <TTaskRuntimeInfo>(); repository.Add(result); return(result); }
/// <summary> /// Initializes a new instance of the <see cref="TaskProcessorRepository"/> class. /// </summary> /// <param name="tasksRepository">The tasks repository.</param> /// <param name="taskRuntimeInfoRepository">The task runtime information repository.</param> /// <param name="taskProcessorsRepository">The task processor runtime information repository.</param> /// <param name="taskSummaryRepository">The task summary repository.</param> /// <param name="taskJobSettingsRepository">The task job settings repository.</param> /// <param name="scheduledTasksRepository">The scheduled tasks repository.</param> /// <exception cref="ArgumentNullException">Parameter <paramref name="tasksRepository"/>, /// <paramref name="taskRuntimeInfoRepository"/>, <paramref name="taskProcessorsRepository"/>, <paramref name="taskProcessorsRepository"/> /// <paramref name="taskJobSettingsRepository"/> or <paramref name="scheduledTasksRepository"/> is null.</exception> protected TaskProcessorRepository( ITaskRepository tasksRepository, ITaskRuntimeInfoRepository taskRuntimeInfoRepository, ITaskProcessorRuntimeInfoRepository taskProcessorsRepository, ITaskSummaryRepository taskSummaryRepository, ITaskJobSettingsRepository taskJobSettingsRepository, IScheduledTaskRepository scheduledTasksRepository) { Trace.WriteLine("ENTER: Constructing '{0}' ...".FormatInvariant(this.GetType().Name)); if (tasksRepository == null) { throw new ArgumentNullException("tasksRepository"); } if (taskRuntimeInfoRepository == null) { throw new ArgumentNullException("taskRuntimeInfoRepository"); } if (taskProcessorsRepository == null) { throw new ArgumentNullException("taskProcessorsRepository"); } if (taskSummaryRepository == null) { throw new ArgumentNullException("taskSummaryRepository"); } if (taskJobSettingsRepository == null) { throw new ArgumentNullException("taskJobSettingsRepository"); } if (scheduledTasksRepository == null) { throw new ArgumentNullException("scheduledTasksRepository"); } this.tasks = tasksRepository; this.taskRuntimeInfo = taskRuntimeInfoRepository; this.taskProcessors = taskProcessorsRepository; this.taskSummary = taskSummaryRepository; this.taskJobSettings = taskJobSettingsRepository; this.scheduledTasks = scheduledTasksRepository; Trace.WriteLine("ENTER: Constructing '{0}' ...".FormatInvariant(this.GetType().Name)); }
internal static ITaskRuntimeInfo Create(this ITaskRuntimeInfoRepository repository) { return(repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, null)); }
internal static TTaskRuntimeInfo Create <TTaskRuntimeInfo>(this ITaskRuntimeInfoRepository repository) where TTaskRuntimeInfo : ITaskRuntimeInfo { return((TTaskRuntimeInfo)repository.Create(Guid.NewGuid(), typeof(FakeTask), DateTime.UtcNow, TaskPriority.Normal, null)); }