How to prevent Json.NET converting enum to string?
问题 The following class public class RequestSections : RequestBase { public RequestSections(Command c, Dictionary<SectionIdentifier, BigInteger> v) : base(c) { VERSIONS = v; } public Dictionary<SectionIdentifier, BigInteger> VERSIONS { get; set; } } is serialized to JSON using JSON.NET and producing the following JSON output: { "VERSIONS": { "Photos": 901, "Music": 902 }, "CMD": 43 } The problem is that SectionIdentifier is enum but JSON.NET converts them to string. public enum SectionIdentifier