序列化
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”作为参数接收一个类型对象,因此你可以将任何内容放入其中。