private void WriteStreamItemMessage(StreamItemMessage message, Utf8JsonWriter writer) { WriteInvocationId(message, writer); writer.WritePropertyName(ItemPropertyNameBytes); JsonSerializer.Serialize(writer, message.Item, message.Item?.GetType(), _payloadSerializerOptions); }
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); }
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); } }
private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer) { WriteInvocationId(message, writer); writer.WritePropertyName(ItemPropertyName); PayloadSerializer.Serialize(writer, message.Item); }