1

Context

My class has many properties, and I would like to serialize only a few of them. I am aware that I can control this via [JsonIgnore] attribute.

Question

Is there any way to ignore all properties except what I annotate with [JsonProperty]?

1 Answer 1

1

Above class:

[JsonObject(MemberSerialization.OptIn)]

Above any property you want to serialize:

[JsonProperty]

Check this link for further information.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.