2024年3月14日

C#中枚举类型Enum字段序列化为json的注意事项

摘要: 1. 枚举类型的字段是可以序列化和反序列化的,只不过序列化后,枚举类型变成了int类型 2. 如果想把枚举类型序列化以后显示为字符串,需要在枚举类型头部添加声明: [JsonConverter(typeof(StringEnumConverter))] public enum InputParamT 阅读全文

posted @ 2024-03-14 10:50 lopengye 阅读(329) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示