Skip to content

Deserialization fails (or is incorrect) for classes which contain Nullable<> or ? #46

@Villenny

Description

@Villenny
    public class TestMe
    {
        public string a { get; set; }
        public string b { get; set; }
        public int? c { get; set; }
        public int? d { get; set; }
    }

                var testMe = new TestMe
                {
                    a = "Test",
                    c = 0
                };
                if (useNetJSON == true)
                {
                    vals[j] = NetJSON.NetJSON.Serialize(testMe);
                    var obj = NetJSON.NetJSON.Deserialize(typeof(TestMe), vals[j]);
                    testMe = (TestMe)obj;
                }

afterwards in the new testMe object c will be null rather than 0.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions