public string At(params Hour[] hours) { if (hours == null || !hours.Any()) { throw new ArgumentNullException(nameof(hours)); } _cron.HourRange = hours .Distinct() .Select(h => ((int)h).ToString()) .Aggregate((prev, curr) => $"{prev},{curr}"); return(_cron.ToString()); }
public string At(params Minute[] minutes) { if (minutes == null || !minutes.Any()) { throw new ArgumentNullException(nameof(minutes)); } _cron.MinuteRange = minutes .Distinct() .Select(m => ((int)m).ToString()) .Aggregate((prev, curr) => $"{prev},{curr}"); return(_cron.ToString()); }
public string Every(int minutes) { if (minutes < 1 || minutes > 59) { throw new ArgumentException("Minutes must be between 1 and 59 inclusive"); } var cron = new Cron { Minute = $"{minutes}" }; return(cron.ToString()); }