internal void Update(InvocationRow newVersion) { // Cast here so that failures occur during the update. Status = (InvocationStatus)newVersion.Status; Result = (ExecutionResult)newVersion.Result; // Set up dates LastDequeuedAt = LoadUtcDateTime(newVersion.LastDequeuedAt); LastSuspendedAt = LoadUtcDateTime(newVersion.LastSuspendedAt); CompletedAt = LoadUtcDateTime(newVersion.CompletedAt); QueuedAt = new DateTimeOffset(newVersion.QueuedAt, TimeSpan.Zero); NextVisibleAt = new DateTimeOffset(newVersion.NextVisibleAt, TimeSpan.Zero); UpdatedAt = new DateTimeOffset(newVersion.UpdatedAt, TimeSpan.Zero); if (String.IsNullOrEmpty(newVersion.Payload)) { Payload = new Dictionary<string, string>(); } else if (CurrentRow == null || !String.Equals(CurrentRow.Payload, newVersion.Payload, StringComparison.Ordinal)) { Payload = InvocationPayloadSerializer.Deserialize(newVersion.Payload); } CurrentRow = newVersion; }
internal void Update(InvocationRow newVersion) { // Cast here so that failures occur during the update. Status = (InvocationStatus)newVersion.Status; Result = (ExecutionResult)newVersion.Result; // Set up dates LastDequeuedAt = LoadUtcDateTime(newVersion.LastDequeuedAt); LastSuspendedAt = LoadUtcDateTime(newVersion.LastSuspendedAt); CompletedAt = LoadUtcDateTime(newVersion.CompletedAt); QueuedAt = new DateTimeOffset(newVersion.QueuedAt, TimeSpan.Zero); NextVisibleAt = new DateTimeOffset(newVersion.NextVisibleAt, TimeSpan.Zero); UpdatedAt = new DateTimeOffset(newVersion.UpdatedAt, TimeSpan.Zero); if (String.IsNullOrEmpty(newVersion.Payload)) { Payload = new Dictionary <string, string>(); } else if (CurrentRow == null || !String.Equals(CurrentRow.Payload, newVersion.Payload, StringComparison.Ordinal)) { Payload = InvocationPayloadSerializer.Deserialize(newVersion.Payload); } CurrentRow = newVersion; }
internal InvocationState(InvocationRow latest) { Update(latest); }