Skip to content

Commit d72f863

Browse files
committed
Add optional startAt parameter to JobTriggerAttribute
The `JobTriggerAttribute` constructor in the `EasyExtensions.Quartz.Attributes` namespace now includes a new optional parameter `startAt` of type `TimeOfDay?`, allowing specification of a specific time of day to start the job. The order of initialization in the constructor has been adjusted to set the `StartAt` property before the `Interval` property. The XML documentation comment for the constructor has been updated to include a description for the new `startAt` parameter.
1 parent 502ffa5 commit d72f863

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Sources/EasyExtensions.Quartz/Attributes/JobTriggerAttribute.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class JobTriggerAttribute : Attribute
1717
/// <summary>
1818
/// Start the job at the specified time.
1919
/// </summary>
20-
public TimeOfDay? StartAt { get; set; }
20+
public TimeOfDay? StartAt { get; }
2121

2222
/// <summary>
2323
/// Start the job immediately.
@@ -27,7 +27,7 @@ public class JobTriggerAttribute : Attribute
2727
/// <summary>
2828
/// Repeat the job forever.
2929
/// </summary>
30-
public bool RepeatForever { get; set; }
30+
public bool RepeatForever { get; }
3131

3232
/// <summary>
3333
/// Create a new instance of <see cref="JobTriggerAttribute"/>.
@@ -38,16 +38,18 @@ public class JobTriggerAttribute : Attribute
3838
/// <param name="seconds"> Seconds. </param>
3939
/// <param name="startNow"> Start now. </param>
4040
/// <param name="repeatForever"> Repeat forever. </param>
41+
/// <param name="startAt"> Start at. </param>
4142
public JobTriggerAttribute(int days = 0, int hours = 0, int minutes = 0, int seconds = 0,
42-
bool startNow = true, bool repeatForever = true)
43+
bool startNow = true, bool repeatForever = true, TimeOfDay? startAt = null)
4344
{
4445
if (days <= 0 && hours <= 0 && minutes <= 0 && seconds <= 0)
4546
{
4647
throw new ArgumentException("At least one of the parameters must be greater than 0.");
4748
}
48-
Interval = new TimeSpan(days, hours, minutes, seconds);
49+
StartAt = startAt;
4950
StartNow = startNow;
5051
RepeatForever = repeatForever;
52+
Interval = new TimeSpan(days, hours, minutes, seconds);
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)