From f4825b912158ae81190d2e4bfc979e38150e558b Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 26 Nov 2024 21:59:40 +0800 Subject: [PATCH] =?UTF-8?q?'Action=E8=BF=94=E5=9B=9E=E5=80=BC=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...24\345\233\236\345\200\274\347\261\273\345\236\213.md" | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 "\351\231\206\346\245\232\347\233\210/20241125Action\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" diff --git "a/\351\231\206\346\245\232\347\233\210/20241125Action\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" "b/\351\231\206\346\245\232\347\233\210/20241125Action\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" new file mode 100644 index 0000000..c621575 --- /dev/null +++ "b/\351\231\206\346\245\232\347\233\210/20241125Action\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" @@ -0,0 +1,8 @@ +# MVC模式中常见的Action的返回值类型 + - 返回常见数据类型,如int、string、IList<> + - IActionResult,返回响应状态码,如200,301,401,404,500等 + - 视图 + - 重定向 + - ActionResult<>,可以同时返回状态码或者常规数据类型 + - JsonResult、ContentResult,返回响应就是纯粹的数据 + - POCO可以返回一个对象,而这个对象在被返回的时候,会被序列化(相对应的是,反序列化 json{"name":"冰冰","age":88}) \ No newline at end of file -- Gitee