Beispiel #1
0
        public static void WriteTLObjectValue(this Utf8JsonWriter writer, TLObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }
            var converter = TLObjectFactory.GetConverterForTLObject(obj);

            converter.TdJsonWriteUnclosedObject(writer, obj);
            writer.WriteEndObject();
        }
Beispiel #2
0
        public static void WriteTLObjectValue(this Utf8JsonWriter writer, TLObjectWithExtra obj)
        {
            if (obj.TLObject == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }
            var converter = TLObjectFactory.GetConverterForTLObject(obj.TLObject);

            converter.TdJsonWriteUnclosedObject(writer, obj.TLObject);
            if (obj.Extra.HasValue)
            {
                writer.WritePropertyName(ExtraPropertyName);
                writer.WriteInt64String(obj.Extra.Value);
            }
            writer.WriteEndObject();
        }