1

Closed

Non-dictionary properties of types that inherit from Dictionary<,> do not get serialized

description

Quite surprised to find that serializing this type, results in empty JSON "{}"

void Main()
{
JsonConvert.SerializeObject(new Foo { Id = "5" }).Dump();
}

class Foo : Dictionary
{
public string Id { get; set;}
}
Closed Jan 9, 2013 at 10:30 AM by JamesNK
Not a bug

comments

rslaney wrote Jan 9, 2013 at 11:02 PM

disagree... why is this not a bug when the object is not serialized with it's public property

georgiosd wrote Jan 10, 2013 at 7:14 AM

Yes, an explanation of why you do not consider this a bug would be great.