We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use an ?int property the value does save to the file correctly but I'm not able to deserialize the value. Any ideas?
`[Serializable] public class ControllerAsset : AutoGeneratedNetworkDevice {
[DataMember] public String Firmware { set; get; } [DataMember] public int? GroupID { set; get; } }`
The text was updated successfully, but these errors were encountered:
What do you get?
Sorry, something went wrong.
It deserializes as null.
The following works:
public class ControllerAsset //: AutoGeneratedNetworkDevice { public String Firmware { set; get; } public int? GroupID { set; get; } } [Test] public static void nullabletest() { var c = new ControllerAsset { GroupID = 10 }; var s = JSON.ToJSON(c); Console.WriteLine(s); var o = JSON.ToObject<ControllerAsset>(s); Assert.AreEqual(10, o.GroupID); }
No branches or pull requests
When I use an ?int property the value does save to the file correctly but I'm not able to deserialize the value. Any ideas?
`[Serializable]
public class ControllerAsset : AutoGeneratedNetworkDevice
{
The text was updated successfully, but these errors were encountered: