R. V.
R. V.

Reputation: 836

ASP .NET - JSON Serializer not working on class instances

Anonymous objects are automatically serialized as expected when returned from controller action. When returning class instance, http response contains only empty json body, why? Where is this documented?

Upvotes: 0

Views: 38

Answers (1)

R. V.
R. V.

Reputation: 836

Ok, I forgot to add default { get; set; } to the properties, this seems to be compulsory for the json serializer.

Upvotes: 1

Related Questions