コード例 #1
0
        public static void AddOrUpdate(
            [NotNull] this IRecurringJobManager manager,
            [NotNull] string recurringJobId,
            [NotNull] Job job,
            [NotNull] string cronExpression,
            [NotNull] TimeZoneInfo timeZone,
            string queue = null)
        {
            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }
            if (timeZone == null)
            {
                throw new ArgumentNullException(nameof(timeZone));
            }

            if (queue != null)
            {
                job.OverrideQueueName(queue);
            }

            manager.AddOrUpdate(
                recurringJobId,
                job,
                cronExpression,
                new RecurringJobOptions {
                TimeZone = timeZone
            });
        }