コード例 #1
0
        private void WriteStreamItemMessage(StreamItemMessage message, Utf8JsonWriter writer)
        {
            WriteInvocationId(message, writer);

            writer.WritePropertyName(ItemPropertyNameBytes);
            JsonSerializer.Serialize(writer, message.Item, message.Item?.GetType(), _payloadSerializerOptions);
        }
コード例 #2
0
ファイル: JsonHubProtocol.cs プロジェクト: wyaow/AspNetCore
        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);
        }
コード例 #3
0
 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);
 }
コード例 #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);
            }
        }
コード例 #5
0
 private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer)
 {
     WriteInvocationId(message, writer);
     writer.WritePropertyName(ItemPropertyName);
     PayloadSerializer.Serialize(writer, message.Item);
 }