Reputation: 836
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
Reputation: 836
Ok, I forgot to add default { get; set; }
to the properties, this seems to be compulsory for the json serializer.
Upvotes: 1