2

I have a WebAPI project that has the StringEnumConverter of JSON.net set to be the default converter for enums.

jsonFormatter.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());

However let's say I have a particular enum that I want to actually serialize as an integer. Is there a converter I can decorate on the property to override the StringEnumConverter and instead use integer?

MindingData
  • 11,924
  • 6
  • 49
  • 68
  • 1
    You can decorate your `enum` or the specific property with `NoConverter` from [this answer](https://stackoverflow.com/a/39739105/3744182) to [Selectively use default JSON converter](https://stackoverflow.com/q/39738714/3744182). In fact this might be a duplicate; agree? – dbc Nov 09 '18 at 23:10

0 Answers0