五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Configuring JSON options in ASP.NET Core

2023-06-03 08:01 作者:Tuple_元組  | 我要投稿

如何格式化 JSON 對象中屬性的大小寫,不同的場景有如下變化:

In an ASP.NET Core application, you can configure the JSON serializer options used by controllers using the?AddJsonOptions?method:

This works well for controllers. .NET 6 introduced minimal APIs for hosting and routing in web applications. This is an easier way to create?small?web APIs. This new model does not use controllers, so you cannot use the?AddJsonOptions?method.?AddJsonOptions?configures?Microsoft.AspNetCore.Http.Json.JsonOptions?using the Dependency Injection (source). So, you can do the same directly. In the following example, I configure the JSON serializer options using the?Configure?method:

The JSON serializer uses the configuration settings

In .NET 6 preview 7, you can also provide the JSON serializer options using?Results.Json(object, JsonSerializerOptions)?(source):

ref:?https://www.meziantou.net/configuring-json-options-in-asp-net-core.htm

Configuring JSON options in ASP.NET Core的評論 (共 條)

分享到微博請遵守國家法律
右玉县| 潮安县| 奉化市| 河西区| 九江市| 上栗县| 香港 | 湘西| 保定市| 清徐县| 修水县| 南乐县| 周宁县| 措美县| 五河县| 西安市| 陕西省| 天等县| 尉犁县| 那曲县| 贵南县| 文山县| 阳朔县| 图片| 南靖县| 安丘市| 资兴市| 宜宾县| 桓台县| 汝城县| 中江县| 北京市| 鄄城县| 永靖县| 祁门县| 万源市| 南投县| 闸北区| 团风县| 凤翔县| 永清县|