Skip to content

Commit 3caa138

Browse files
committed
[增加]1. 增加JSON序列化的大小写忽略判断
1 parent 5a2071e commit 3caa138

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

GameFrameX.Utility/JsonHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public static class JsonHelper
1818
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
1919
// 忽略循环引用
2020
ReferenceHandler = ReferenceHandler.IgnoreCycles,
21+
// 大小写判断
22+
PropertyNameCaseInsensitive = true,
2123
// 添加自定义转换器,类似于 StringEnumConverter
2224
Converters =
2325
{
@@ -34,6 +36,8 @@ public static class JsonHelper
3436
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
3537
// 忽略循环引用
3638
ReferenceHandler = ReferenceHandler.IgnoreCycles,
39+
// 大小写判断
40+
PropertyNameCaseInsensitive = true,
3741
// 格式化 JSON
3842
WriteIndented = true,
3943
// 添加自定义转换器,类似于 StringEnumConverter

0 commit comments

Comments
 (0)