Deserialize() публичный статический Метод

public static Deserialize ( string payload ) : string>.Dictionary
payload string
Результат string>.Dictionary
Пример #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
        public void SimpleDeserialization(Dictionary <string, string> expectedPayload, string json)
        {
            var deserialized = InvocationPayloadSerializer.Deserialize(json);

            Assert.True(expectedPayload.SequenceEqual(deserialized));
        }