0

I have the following line in my .NET Core code :

var serializedstuff = Newtonsoft.Json.JsonConvert.SerializeObject(myuserclass);

What I want to do is to omit almost all fields with the exception of two in that specific serialization. I know I can annotate the class to make this happen, but I want to have a full serialization in all other cases except for this one.

Is it possible to do something like this?

dbc
  • 91,441
  • 18
  • 186
  • 284
Matias Barrios
  • 4,123
  • 2
  • 15
  • 39

0 Answers0