SlideShare a Scribd company logo
MVC – Action Filter
Jason
Types of Action Filter
Authorization Filter
Action Filter
Result Filter
Action Filter


You can apply filters either to
individual action methods or to all the
action methods on a given controller
Action Filter Method
Method

When Called

OnActionExecuting()

Before the action method runs

OnActionExecuted()

After the action method runs

OnResultExecuting()

Before the ActionResult isexecuted

OnResultExecuted()

After the ActionResult is executed
Action Filter
Exception Filter
Reference


MSDN – Action Filter
◦ http://msdn.microsoft.com/en-us/library/dd381609(v=vs.100).aspx



Pro ASP.NET MVC 2 Framework,
Second Edition
◦ ltfs2rdeBookASP.NETMVC2

More Related Content

What's hot

Quality for developers
Quality for developersQuality for developers
Quality for developers
Dharshana Kasun Warusavitharana
 
Unit test
Unit testUnit test
Unit test
Tran Duc
 
Unit testing using jasmine in Javascript
Unit testing using jasmine in JavascriptUnit testing using jasmine in Javascript
Unit testing using jasmine in Javascript
Deepak More
 
淺談 iOS Unit test
淺談 iOS Unit test淺談 iOS Unit test
淺談 iOS Unit test
Jason Huang
 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting stared
Liyao Chen
 
Jira work flows
Jira work flowsJira work flows
Jira work flows
Shivaraj R
 
Unit testing
Unit testingUnit testing
Unit testing
Vinod Wilson
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
Francesco Garavaglia
 
Template pattern
Template patternTemplate pattern
Template pattern
Fahim Fana
 
Scala test
Scala testScala test
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
Colombo Selenium Meetup
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
Baskar K
 
Introduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkIntroduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit framework
BugRaptors
 
Selenium with testng and eclipse ide
Selenium with testng and eclipse ideSelenium with testng and eclipse ide
Selenium with testng and eclipse ide
Testertester Jaipur
 
Unit test documentation
Unit test documentationUnit test documentation
Unit test documentation
Anjan Debnath
 
Test ng tutorial
Test ng tutorialTest ng tutorial
Test ng tutorial
Srikrishna k
 
Unit Testing with Python
Unit Testing with PythonUnit Testing with Python
Unit Testing with Python
MicroPyramid .
 
ASP.NET MVC controllers
ASP.NET MVC controllersASP.NET MVC controllers
ASP.NET MVC controllers
Mahmoud Tolba
 
Unit testing in Force.com platform
Unit testing in Force.com platformUnit testing in Force.com platform
Unit testing in Force.com platform
Chamil Madusanka
 
The complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David TzemachThe complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David Tzemach
David Tzemach
 

What's hot (20)

Quality for developers
Quality for developersQuality for developers
Quality for developers
 
Unit test
Unit testUnit test
Unit test
 
Unit testing using jasmine in Javascript
Unit testing using jasmine in JavascriptUnit testing using jasmine in Javascript
Unit testing using jasmine in Javascript
 
淺談 iOS Unit test
淺談 iOS Unit test淺談 iOS Unit test
淺談 iOS Unit test
 
iOS Unit test getting stared
iOS Unit test getting starediOS Unit test getting stared
iOS Unit test getting stared
 
Jira work flows
Jira work flowsJira work flows
Jira work flows
 
Unit testing
Unit testingUnit testing
Unit testing
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
 
Template pattern
Template patternTemplate pattern
Template pattern
 
Scala test
Scala testScala test
Scala test
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Introduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkIntroduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit framework
 
Selenium with testng and eclipse ide
Selenium with testng and eclipse ideSelenium with testng and eclipse ide
Selenium with testng and eclipse ide
 
Unit test documentation
Unit test documentationUnit test documentation
Unit test documentation
 
Test ng tutorial
Test ng tutorialTest ng tutorial
Test ng tutorial
 
Unit Testing with Python
Unit Testing with PythonUnit Testing with Python
Unit Testing with Python
 
ASP.NET MVC controllers
ASP.NET MVC controllersASP.NET MVC controllers
ASP.NET MVC controllers
 
Unit testing in Force.com platform
Unit testing in Force.com platformUnit testing in Force.com platform
Unit testing in Force.com platform
 
The complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David TzemachThe complete guide for software integration testing | David Tzemach
The complete guide for software integration testing | David Tzemach
 

Viewers also liked

Mark c# overview
Mark   c# overviewMark   c# overview
Mark c# overview
LearningTech
 
X document xpath 小發現
X document xpath 小發現X document xpath 小發現
X document xpath 小發現LearningTech
 
Sql server 交易機制與 log
Sql server 交易機制與 logSql server 交易機制與 log
Sql server 交易機制與 logLearningTech
 
Yield howar 20130607d
Yield howar 20130607dYield howar 20130607d
Yield howar 20130607d
LearningTech
 
Peggy optimist
Peggy   optimistPeggy   optimist
Peggy optimist
LearningTech
 
20131104 basic msbuild by Anney
20131104 basic msbuild by Anney20131104 basic msbuild by Anney
20131104 basic msbuild by Anney
LearningTech
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
LearningTech
 
Observer pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expressionObserver pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expressionLearningTech
 
Bcp
BcpBcp
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
LearningTech
 
20130329 introduction to linq
20130329 introduction to linq20130329 introduction to linq
20130329 introduction to linq
LearningTech
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
Design pattern builder 20131115
Design pattern   builder 20131115Design pattern   builder 20131115
Design pattern builder 20131115
LearningTech
 

Viewers also liked (16)

Mark c# overview
Mark   c# overviewMark   c# overview
Mark c# overview
 
X document xpath 小發現
X document xpath 小發現X document xpath 小發現
X document xpath 小發現
 
Sql server 交易機制與 log
Sql server 交易機制與 logSql server 交易機制與 log
Sql server 交易機制與 log
 
Css advance
Css   advanceCss   advance
Css advance
 
Yield howar 20130607d
Yield howar 20130607dYield howar 20130607d
Yield howar 20130607d
 
Html basic
Html basicHtml basic
Html basic
 
Peggy optimist
Peggy   optimistPeggy   optimist
Peggy optimist
 
20131104 basic msbuild by Anney
20131104 basic msbuild by Anney20131104 basic msbuild by Anney
20131104 basic msbuild by Anney
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
Aspnet mvc4
Aspnet mvc4Aspnet mvc4
Aspnet mvc4
 
Observer pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expressionObserver pattern, delegate, event, lambda expression
Observer pattern, delegate, event, lambda expression
 
Bcp
BcpBcp
Bcp
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
 
20130329 introduction to linq
20130329 introduction to linq20130329 introduction to linq
20130329 introduction to linq
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Design pattern builder 20131115
Design pattern   builder 20131115Design pattern   builder 20131115
Design pattern builder 20131115
 

More from LearningTech

vim
vimvim
PostCss
PostCssPostCss
PostCss
LearningTech
 
ReactJs
ReactJsReactJs
ReactJs
LearningTech
 
Docker
DockerDocker
Docker
LearningTech
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
LearningTech
 
node.js errors
node.js errorsnode.js errors
node.js errors
LearningTech
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
LearningTech
 
Expression tree
Expression treeExpression tree
Expression tree
LearningTech
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
LearningTech
 
flexbox report
flexbox reportflexbox report
flexbox report
LearningTech
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
LearningTech
 
Reflection & activator
Reflection & activatorReflection & activator
Reflection & activator
LearningTech
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
LearningTech
 
Node child process
Node child processNode child process
Node child process
LearningTech
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
LearningTech
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech
 
Expression tree
Expression treeExpression tree
Expression tree
LearningTech
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
LearningTech
 
git command
git commandgit command
git command
LearningTech
 
Asp.net MVC DI
Asp.net MVC DIAsp.net MVC DI
Asp.net MVC DI
LearningTech
 

More from LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection & activator
Reflection & activatorReflection & activator
Reflection & activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
git command
git commandgit command
git command
 
Asp.net MVC DI
Asp.net MVC DIAsp.net MVC DI
Asp.net MVC DI
 

Recently uploaded

Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 

Recently uploaded (20)

Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 

Action filter

Editor's Notes

  1. public class ShowMessageAttribute : ActionFilterAttribute{ public string Message { get; set; } public override void OnActionExecuting(ActionExecutingContextfilterContext) { filterContext.HttpContext.Response.Write("[BeforeAction " + Message + "]"); } public override void OnActionExecuted(ActionExecutedContextfilterContext) { filterContext.HttpContext.Response.Write("[AfterAction " + Message + "]"); } public override void OnResultExecuting(ResultExecutingContextfilterContext) { filterContext.HttpContext.Response.Write("[BeforeResult " + Message + "]"); } public override void OnResultExecuted(ResultExecutedContextfilterContext) { filterContext.HttpContext.Response.Write("[AfterResult " + Message + "]"); } }