Implementing Action Filters in ASP.NET Core



Implementing Action Filters in ASP.NET Core

Implementing Action Filters in ASP.NET Core

Want to learn more about building APIs and getting a six-figure income? Check out:
►► OUR BOOK: https://code-maze.com/ultimate-aspnet-core-3-web-api/?source=yt
►► OUR BLAZOR WEBASSEMBLY COURSE: https://code-maze.com/blazor-webassembly-course/?source=yt ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
DESCRIPTION:
In this video, we are going to learn how to use Action Filters in ASP.NET Core applications to create readable and maintainable actions.

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
LINKS MENTIONED IN THE VIDEO:
To visit the whole article and download the source code visit:
►► https://code-maze.com/action-filters-aspnetcore
To watch the Global Error Handling video, visit:
►► https://www.youtube.com/watch?v=tk1QK71DVtg
To visit our site:
►► https://code-maze.com/

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
MORE CODE MAZE STUFF?
And you can check out our Merch here:
►► https://www.redbubble.com/people/vpecanac/works/44764889-code-maze-merch?asc=u

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
FOLLOW US ON SOCIAL MEDIA!
►► https://twitter.com/CodeMazeBlog
►► https://www.facebook.com/CodeMazeBlog

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
VIDEO SUMMARY:
Filters in .NET offer a great way to hook into the MVC action invocation pipeline. Therefore, we can use filters to extract code that can be reused and make our actions cleaner and maintainable. There are some filters that are already provided by ASP.NET Core like the authorization filter, and there are the custom ones that we can create ourselves.

There are different filter types:

Authorization filters – They run first to determine whether a user is authorized for the current request
Resource filters – They run right after the authorization filters and are very useful for caching and performance
Action filters – They run right before and after the action method execution
Exception filters – They are used to handle exceptions before the response body is populated
Result filters – They run before and after the execution of the action methods result.
In this video, we are going to talk about Action filters and how to use them to create a cleaner and reusable code in our Web API.

Comments are closed.