Hi, I want to use JsConfig.TreatEnumAsInteger only on a specific type / member. In the bellow example, I want to TreatEnumAsInteger for enum1. what are my options? Thanks
TreatEnumAsInteger
public class Root{ pubic Enum1 enum1 {get;set;} pubic Enum2 enum2 {get;set;} }
There is no JsConfig scoped to the containing type.
You can serialize an Enum as an int by annotating it with [Flags] or [EnumAsInt] attribute, e.g:
[Flags]
[EnumAsInt]
[Flags] public enum Enum1 {} [EnumAsInt] public enum Enum1 {}