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
  • 104,963
  • 20
  • 228
  • 340
Matias Barrios
  • 4,674
  • 3
  • 22
  • 49

0 Answers0