Пример #1
0
 private static void WriteInvocationId(HubInvocationMessage message, Utf8JsonWriter writer)
 {
     if (!string.IsNullOrEmpty(message.InvocationId))
     {
         writer.WriteString(InvocationIdPropertyNameBytes, message.InvocationId);
     }
 }
Пример #2
0
 private static void WriteInvocationId(HubInvocationMessage message, JsonTextWriter writer)
 {
     if (!string.IsNullOrEmpty(message.InvocationId))
     {
         writer.WritePropertyName(InvocationIdPropertyName);
         writer.WriteValue(message.InvocationId);
     }
 }
Пример #3
0
 private void WriteHeaders(Utf8JsonWriter writer, HubInvocationMessage message)
 {
     if (message.Headers != null && message.Headers.Count > 0)
     {
         writer.WriteStartObject(HeadersPropertyNameBytes);
         foreach (var value in message.Headers)
         {
             writer.WriteString(value.Key, value.Value);
         }
         writer.WriteEndObject();
     }
 }
Пример #4
0
 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();
     }
 }