Exemple #1
0
        /// <summary>
        /// Builds <see cref="RecurringJob"/> automatically within specified interface or class.
        /// </summary>
        /// <param name="typesProvider">The provider to get specified interfaces or class.</param>
        public static void AddOrUpdate(Func <IEnumerable <Type> > typesProvider)
        {
            if (typesProvider == null)
            {
                throw new ArgumentNullException(nameof(typesProvider));
            }

            IRecurringJobBuilder builder = new RecurringJobBuilder();

            builder.Build(typesProvider);
        }
Exemple #2
0
        /// <summary>
        /// Builds <see cref="RecurringJob"/> automatically with <seealso cref="IConfigurationProvider"/>.
        /// </summary>
        /// <param name="provider"><see cref="IConfigurationProvider"/></param>
        public static void AddOrUpdate(IConfigurationProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            IRecurringJobBuilder builder = new RecurringJobBuilder();

            AddOrUpdate(provider.Load());
        }
Exemple #3
0
        /// <summary>
        /// Builds <see cref="RecurringJob"/> automatically with the collection of <seealso cref="RecurringJobInfo"/>.
        /// </summary>
        /// <param name="recurringJobInfos">The collection of <see cref="RecurringJobInfo"/>.</param>
        public static void AddOrUpdate(IEnumerable <RecurringJobInfo> recurringJobInfos)
        {
            if (recurringJobInfos == null)
            {
                throw new ArgumentNullException(nameof(recurringJobInfos));
            }

            IRecurringJobBuilder builder = new RecurringJobBuilder();

            builder.Build(() => recurringJobInfos);
        }