Deserialize problem

Jun 26, 2009 at 10:46 PM

I have this class

    public class RoleTransfer
        public RoleTransferOperation Operation { get; set; }   //This is enum type
        public string RoleName { get; set; }
        public RoleTransferDirection Direction { get; set; }   //This is enum type
I try to Deserialize this string: {"Operation":"1","RoleName":"Admin","Direction":"0"}

I get the right value for the Operation and Direction members,
but I get null for the RoleName member.

Jun 28, 2009 at 12:04 AM

Works for me.

Jun 28, 2009 at 2:21 AM
Edited Jun 28, 2009 at 2:21 AM

I’m very excited that it works for you, but any idea why it doesn’t work for me.


Jul 4, 2009 at 5:31 AM

I'm stoked too.

You haven't mentioned what version of Json.NET you are using. The example works for me using the latest version of the Json.NET source code.