If I have an object that I return from WebApi, is it possible to mark one of the properties as hidden ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use:
These will hide your property from both kinds of serialization.
I have always tried to mix both in a single class but
JSonIgnoreAtrributeis a sealed class and does not leave us with a seamless integration option.So the straight forward way is to add both attributes on your ignorable property.