public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var messageData = value as IMessageData;
            if (messageData == null)
                return;

            var reference = new MessageDataReference {Reference = messageData.Address};

            serializer.Serialize(writer, reference);
        }
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var messageData = value as IMessageData;

            if (messageData == null)
            {
                return;
            }

            var reference = new MessageDataReference {
                Reference = messageData.Address
            };

            serializer.Serialize(writer, reference);
        }
Exemple #3
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (value is IMessageData messageData && messageData.HasValue)
            {
                var reference = new MessageDataReference {
                    Reference = messageData.Address
                };

                if (messageData is IInlineMessageData inlineMessageData)
                {
                    inlineMessageData.Set(reference);
                }

                serializer.Serialize(writer, reference);
            }