博客
关于我
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/

你可能感兴趣的文章
Easyui datagrid combobox输入框非法输入判断与事件总结
查看>>
Vue 使用Use、prototype自定义全局插件
查看>>
我,管理100多人技术团队的二三事
查看>>
webpack 的 sourse-map 中 eval、cheap、inline 和 module 各是什么意思?
查看>>
设计模式点滴
查看>>
《天风文章》V1.0.0使用说明
查看>>
许久没来了...
查看>>
javascript 实现页面上禁止选择(复制)
查看>>
[转]Best practices for creating websites in IIS 6.0
查看>>
发布一款小软件:和讯博客助手-新闻采集测试版- 0.1.0
查看>>
Angular入门到精通系列教程(10)- 指令(Directive)
查看>>
2021 Top 100 C#/.NET Interview Questions And Answers
查看>>
通过VS2010性能分析来查找代码中那些地方最损耗资源
查看>>
数值压缩存储方法Varint
查看>>
一个简单基于LRU连接检测实现
查看>>
dotnet core开源博客系统XBlog介绍
查看>>
.net core自定义高性能的Web API服务网关
查看>>
BeetleX服务网关之限流和缓存
查看>>
vue-autoui自匹配webapi的UI控件
查看>>
EFCore之SQL扩展组件BeetleX.EFCore.Extension
查看>>