博客
关于我
ASP.NET MVC Action Filters
阅读量:440 次
发布时间:2019-03-06

本文共 808 字,大约阅读时间需要 2 分钟。

在看这篇的时候,提到了 Roni Schuetz在codeplex上创建的一个项目。计划在5月10日推出第一个版本。 项目计划包含的Action Filter:

  • Action filter for creating easy REST API with JSON and XML
  • Action filter for logging scenarios
  • Action filter for microsoft health monitoring
  • Action filter for client caching
  • Action filter for client compression
  • Action filter for server caching
  • Action filter for controller execution time measurement

简要介绍一下Action Filter:Action Filter作为一个可以应用到Controller Action(或者是整个controller)上的属性(Attribute),改变Action执行的行为。ASP.NET MVC Framework包括几种Action Filter:

  • OutputCache – 在指定的时间内缓存Controller Action的输出。
  • HandleError – 处理Controller Action发生错误的情况。
  • Authorize – 通过制定的用户或者角色约束访问权限。

你同时可以创建自己的Action Filter,比如说要实现一个自定义的验证系统,那么可能需要创建一个自定义的Action Filter,或者说当你需要改变Controller Action返回的View data的时候,也可以通过创建自定义Action Filter实现。

关于Action Filter的具体内容可参考 。

转载地址:http://mfifz.baihongyu.com/

你可能感兴趣的文章
使用Redis作为Spring Security OAuth2的token存储
查看>>
【SOLVED】Linux使用sudo到出现输入密码提示延迟时间长
查看>>
springmvc转springboot过程中访问jsp报Whitelabel Error Page错误
查看>>
项目引入非配置的文件,打成war包后测试报错的可能原因
查看>>
Git学习笔记
查看>>
不需要爬虫也能轻松获取 unsplash 上的图片
查看>>
痞子衡嵌入式:语音处理工具pzh-speech诞生记(2)- 界面构建(wxFormBuilder3.8.0)
查看>>
痞子衡嵌入式:极易上手的可视化wxPython GUI构建工具(wxFormBuilder)
查看>>
痞子衡嵌入式:串口调试工具pzh-com诞生记(2)- 界面构建(wxFormBuilder3.8.0)
查看>>
elementUi源码解析(1)--项目结构篇
查看>>
Nmap扫描工具介绍
查看>>
算法笔记:递归、动态规划
查看>>
常用Windows 快捷键
查看>>
linux命令-压缩与打包
查看>>
ORACLE 11g 生产中高水位线(HWM)处理
查看>>
weblogic 服务器部署SSL证书
查看>>
Oracle Orion tool check io(ORACLE Orion 工具查看以及校验IO)
查看>>
oracle 11g not in 与not exists 那个高效?
查看>>
html5 Game开发系列文章之 零[开篇]
查看>>
ES6基础之——new Set
查看>>