序列化

 static void Main(string[] args)
    {
        Book[] books = new Book[3];
        Author author = new Author(89,"Aldous Huxley","Author",books);
        string objectDeserialized = JsonConvert.SerializeObject(author); 
        //Converting author into json
    }

方法“.SerializeObject”作為引數接收一個型別物件,因此你可以將任何內容放入其中。