Browse Source

修改枚举序列化时为大驼峰命名法

develop
刘向辉 3 years ago
parent
commit
e04a05061f
  1. 4
      AX.WebDrillServer/Program.cs

4
AX.WebDrillServer/Program.cs

@ -124,8 +124,8 @@ builder.Services
options.PayloadSerializerOptions.PropertyNameCaseInsensitive = true;
options.PayloadSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
options.PayloadSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase;
//全局配置signalr json 转枚举使用stringName还是intValue
options.PayloadSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
//全局配置signalr json 转枚举使用stringName还是intValue, 枚举采用大驼峰命名法(区别于属性和api的小驼峰)
options.PayloadSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
//#region Custom Services

Loading…
Cancel
Save