Deserializing an empty array using Json.NET
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got a C# application that uses Json.NET v7.0.1. As a result of a REST call, I get back some JSON in the form of: { "messages": [ {"phoneNumber":"123-456-7890", "smsText":"abcd1234="}, {"phoneNumber":"234-567-8901", "smsText":"efgh5678="}, {"phoneNumber":"345-678-9012", "smsText":"12345asdf"} ] } If there is no message data to return, the JSON that I get back looks like this: { "messages": [ ] } My Message class looks like this: public class Message { public string PhoneNumber { get; set; } public string SmsText { get; set; } public