Пример #1
0
        /// <inheritdoc/>
        public override void Write(Utf8JsonWriter writer, DataSet value, JsonSerializerOptions options)
        {
            if (value == null)
            {
                writer.WriteNullValue();
                return;
            }

            var jsonWriter = new JsonWriterAdapter(writer, null);

            jsonWriter.Write(value);
        }
Пример #2
0
        /// <inheritdoc/>
        public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, JsonSerializer serializer)
        {
            var dataRow = value as DataRow;

            if (dataRow == null)
            {
                writer.WriteNull();
                return;
            }

            var jsonWriter = new JsonWriterAdapter(writer, null);

            jsonWriter.Write(dataRow);
        }