五月天青色头像情侣网名,国产亚洲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的評論 (共 條)

分享到微博請遵守國家法律
乾安县| 福建省| 若尔盖县| 遵化市| 正定县| 筠连县| 兴安盟| 奉化市| 丹凤县| 常宁市| 开原市| 靖州| 澳门| 晋州市| 酉阳| 泰宁县| 伊金霍洛旗| 安新县| 寻乌县| 永昌县| 镇雄县| 南陵县| 墨竹工卡县| 林芝县| 顺义区| 成都市| 武汉市| 婺源县| 神农架林区| 田林县| 尼勒克县| 孟村| 万全县| 翁源县| 武鸣县| 平山县| 昆山市| 图片| 安福县| 威远县| 中牟县|