Ejemplo n.º 1
0
        private void WriteStreamItemMessage(StreamItemMessage message, Utf8JsonWriter writer)
        {
            WriteInvocationId(message, writer);

            writer.WritePropertyName(ItemPropertyNameBytes);
            JsonSerializer.Serialize(writer, message.Item, message.Item?.GetType(), _payloadSerializerOptions);
        }
Ejemplo n.º 2
0
        private void WriteStreamItemMessage(StreamItemMessage message, Utf8JsonWriter writer)
        {
            WriteInvocationId(message, writer);

            using var token = GetParsedObject(message.Item, message.Item?.GetType());
            token.RootElement.WriteAsProperty(ItemPropertyNameBytes.EncodedUtf8Bytes, writer);
        }
 private void WriteStreamingItemMessage(StreamItemMessage message, ref MessagePackWriter writer)
 {
     writer.WriteArrayHeader(4);
     writer.Write(HubProtocolConstants.StreamItemMessageType);
     PackHeaders(message.Headers, ref writer);
     writer.Write(message.InvocationId);
     WriteArgument(message.Item, ref writer);
 }
Ejemplo n.º 4
0
        private void WriteStreamItemMessage(StreamItemMessage message, Utf8JsonWriter writer)
        {
            WriteInvocationId(message, writer);

            writer.WritePropertyName(ItemPropertyNameBytes);
            if (message.Item == null)
            {
                writer.WriteNullValue();
            }
            else
            {
                JsonSerializer.Serialize(writer, message.Item, message.Item.GetType(), _payloadSerializerOptions);
            }
        }
Ejemplo n.º 5
0
 private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer)
 {
     WriteInvocationId(message, writer);
     writer.WritePropertyName(ItemPropertyName);
     PayloadSerializer.Serialize(writer, message.Item);
 }