/// <inheritdoc/>
        public override DataSet Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            var jsonTokenizer = new JsonTokenizer(ref reader);
            var tokens        = jsonTokenizer.GetTokens(ref reader);
            var jsonReader    = new JsonReaderAdapter(tokens, null);
            var dataSet       = CreateDataSet(typeToConvert);

            jsonReader.Deserialize(dataSet, true);

            return(dataSet);
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var jsonReader = new JsonReaderAdapter(reader, null);

            var dataSet = existingValue as DataSet;

            if (dataSet == null)
            {
                dataSet = CreateDataSet(objectType);
            }
            jsonReader.Deserialize(dataSet, true);

            return(dataSet);
        }