private static void WriteInvocationId(HubInvocationMessage message, JsonTextWriter writer) { if (!string.IsNullOrEmpty(message.InvocationId)) { writer.WritePropertyName(InvocationIdPropertyName); writer.WriteValue(message.InvocationId); } }
private static void WriteHubInvocationMessageCommon(HubInvocationMessage message, JsonTextWriter writer, int type) { if (!string.IsNullOrEmpty(message.InvocationId)) { writer.WritePropertyName(InvocationIdPropertyName); writer.WriteValue(message.InvocationId); } WriteMessageType(writer, type); }
private void WriteHeaders(JsonTextWriter writer, HubInvocationMessage message) { if (message.Headers != null && message.Headers.Count > 0) { writer.WritePropertyName(HeadersPropertyName); writer.WriteStartObject(); foreach (var value in message.Headers) { writer.WritePropertyName(value.Key); writer.WriteValue(value.Value); } writer.WriteEndObject(); } }