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 0000000000000000000000000000000000000000..c621575f2ab83d75755161718e1afc5b85a34eb1 --- /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