我有这段代码:
//JSON is in Jil library
var a = JSON.Deserialize(@"{""PhoneNumber"": ""09214523155"",""Password"": ""1928160"",""Token"": ""string"",""SubSystem"": ""string"",""Version"": 0,""DeviceType"": 0} ", typeof(LoginContactInput), Options.ISO8601);
这是我的LoginContactInput
课程和DeviceType
枚举:
public class LoginContactInput
{
public string PhoneNumber { get; set; }
public string Password { get; set; }
public string Token { get; set; }
public string SubSystem { get; set; }
public int Version { get; set; }
public DeviceType DeviceType { get; set; } //DeviceType is an Enum
}
public enum DeviceType
{
Mobile,
Server
}
但这引发了一个例外:Expected character: '"'
我认为我的json是正确的
出了什么问题?