public static string ParseCheckpointTagCorrelationId(this string source) { try { if (string.IsNullOrEmpty(source)) return null; var reader = new JsonTextReader(new StringReader(source)); if (!reader.Read()) return null; if (reader.TokenType != JsonToken.StartObject) return null; while (true) { CheckpointTag.Check(reader.Read(), reader); if (reader.TokenType == JsonToken.EndObject) break; if (reader.TokenType != JsonToken.PropertyName) return null; var name = (string) reader.Value; switch (name) { default: if (!reader.Read()) return null; var jToken = JToken.ReadFrom(reader); if (name == "$correlationId") return jToken.ToString(); break; } } return null; } catch (JsonReaderException) { return null; } }