Example #1
0
        /// <summary>
        /// 更新任务执行计划
        /// </summary>
        /// <param name="trigger">执行计划</param>
        /// <returns>执行结果</returns>
        static void UpdateTrigger(Trigger trigger)
        {
            var nowTrigger = triggerRepository.Get(QueryFactory.Create <TriggerQuery>(c => c.Id == trigger.Id));

            if (nowTrigger == null)
            {
                throw new Exception("请指定正确的要操作的信息");
            }
            IEnumerable <string> excludePropertys = ExpressionHelper.GetExpressionPropertyNames <Trigger>(t => t.StartTime, t => t.EndTime, t => t.PrevFireTime, t => t.NextFireTime);

            nowTrigger.ModifyFromOtherTrigger(trigger, excludePropertys);
            nowTrigger.Save();
        }