Newtonsoft Object → Get JSON string

前端 未结 1 1180
予麋鹿
予麋鹿 2021-02-06 22:18

I have an object that is created by Newtonsoft\'s JSON serializer. I need to get the JSON string that was used to create the object. How do I serialize the object into a simple

1条回答
  •  無奈伤痛
    2021-02-06 23:19

    Try this:

    public string jsonOut()
    {
        // Returns JSON string.
        return JsonConvert.SerializeObject(this);       
    }
    

    0 讨论(0)
提交回复
热议问题