public static ITrigger GetTrigger(this SnapshotRule rule) { TriggerBuilder builder = TriggerBuilder.Create() .WithIdentity(rule.ToString(), "SnapshotJob") .WithCronSchedule(rule.GeneratedCron) .StartAt(rule.PeriodStart) .UsingJobData("RuleId", rule.Id) .WithDescription(rule.ToString()); if (rule.PeriodEndEnabled) { builder = builder.EndAt(rule.PeriodEnd); } if (rule.HasCalendar()) { builder = builder.ModifiedByCalendar(rule.GetCalendarName()); } return(builder.Build()); }
public static string GetCalendarName(this SnapshotRule rule) { return(rule.ToString()); }