官术网_书友最值得收藏!

Explicit return type

The simplest form of an action method is the one where the return type is a predefined .NET type, such as primitives or classes you have created. When the method returns a value, the ASP.NET Core pipeline create a success response (with the status code 200 OK) and serializes the value with a formatter that is suitable to the content type that the client requested (via the Accept header in the HTTP request) or with the configured default formatter (the JSON formatter, unless configured otherwise). 

Although returning an explicit predefined type is the simplest way to create actions, it's also the most restricted way. My recommendation is not to use this method, and instead, configure all of your actions to return ActionResult<T> or IActionResult.

主站蜘蛛池模板: 恩施市| 贵州省| 梁平县| 新和县| 河北区| 永清县| 遂昌县| 长海县| 东丰县| 丰镇市| 安塞县| 鹤壁市| 冕宁县| 视频| 普格县| 邵阳市| 洞头县| 临泽县| 新余市| 壶关县| 尼勒克县| 家居| 白水县| 阿勒泰市| 浠水县| 临沧市| 梧州市| 成安县| 甘洛县| 乐业县| 广南县| 贡嘎县| 阜康市| 松溪县| 大竹县| 清苑县| 信丰县| 上杭县| 沁阳市| 托克托县| 双峰县|