Skip to content

Commit 6e04678

Browse files
Make job start,end time nullable
1 parent 4c2ff0a commit 6e04678

File tree

1 file changed

+4
-4
lines changed
  • src/ServiceManagement/Automation/Commands.Automation/Model

1 file changed

+4
-4
lines changed

src/ServiceManagement/Automation/Commands.Automation/Model/Job.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public Job(string accountName, WindowsAzure.Management.Automation.Models.Job job
4747
this.Id = job.Properties.JobId;
4848
this.CreationTime = job.Properties.CreationTime.ToLocalTime();
4949
this.LastModifiedTime = job.Properties.LastModifiedTime.ToLocalTime();
50-
this.StartTime = job.Properties.StartTime;
50+
this.StartTime = job.Properties.StartTime.HasValue ? job.Properties.StartTime : null;
5151
this.Status = job.Properties.Status;
5252
this.StatusDetails = job.Properties.StatusDetails;
5353
this.RunbookName = job.Properties.Runbook.Name;
5454
this.Exception = job.Properties.Exception;
55-
this.EndTime = job.Properties.EndTime;
55+
this.EndTime = job.Properties.EndTime.HasValue ? job.Properties.StartTime : null;
5656
this.LastStatusModifiedTime = job.Properties.LastStatusModifiedTime;
5757
this.JobParameters = new Hashtable(StringComparer.InvariantCultureIgnoreCase);
5858
foreach (var kvp in job.Properties.Parameters.Where(kvp => 0 != String.Compare(kvp.Key, Constants.JobStartedByParameterName, CultureInfo.InvariantCulture,
@@ -97,12 +97,12 @@ public Job()
9797
/// <summary>
9898
/// Gets or sets the start time of the job.
9999
/// </summary>
100-
public DateTimeOffset StartTime { get; set; }
100+
public DateTimeOffset? StartTime { get; set; }
101101

102102
/// <summary>
103103
/// Gets or sets the end time of the job.
104104
/// </summary>
105-
public DateTimeOffset EndTime { get; set; }
105+
public DateTimeOffset? EndTime { get; set; }
106106

107107
/// <summary>
108108
/// Gets or sets the exception of the job.

0 commit comments

Comments
 (0)