コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 internal InvocationState(InvocationRow latest)
 {
     Update(latest);
 }
コード例 #4
0
 internal InvocationState(InvocationRow latest)
 {
     Update(latest);
 }