C# : Reduce size of Json

I want to reduce a json like :

    {
    
        "data1" : "myData1",
        "data2" : "myData2",
        "data3" : "myData3",
        "data4" : "myData4",
        "data5" : "myData5",
        "data6" : "myData6",
        "data7" : "myData7",
        "data8" : "myData8",
    }

Because I only use some values. Example :

    {
        "data1" : "myData1",
        "data5" : "myData5",
        "data8" : "myData8",
    }

For now, I am creating a class like :

    public class MyExampleDataClass
    {
        public string data1;
        public string data5;
        public string data8;
    }

And I use Newtonsoft for Deserialize and Serialize my json :

    var reduceJson = Newtonsoft.Json.JsonConvert.SerializeObject(
        Newtonsoft.Json.JsonConvert.DeserializeObject<MyExampleDataClass>(myJson));

Did you know a better way to do this ? Input : string (my json) Output : string (my reduce Json)

Thanks.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum