First off, I know I could just use the built-in middleware (ie app.UseResponseCompression();), but I'm having to do this to support a legacy applicati ...
First off, I know I could just use the built-in middleware (ie app.UseResponseCompression();), but I'm having to do this to support a legacy applicati ...
I have an authorization filter to be applied to all controller's actions in order to secure application's endpoints (e.g CustomAuthorizationFilter : I ...
I am trying to create custom log filter in my MVC application. Following is my code In the above code, I was trying to pass the service instance to ...
I've made an authorize filter (by inheriting the new IAsyncAuthorizationFilter), should I also inherit IFilterMetadata, and why/why not? Thank you. ...
I read this https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/filters?view=aspnetcore-3.1#filter-scopes-and-order-of-execution, and it seem ...
I am practicing about validations in attributes for DRY reasons but I get some examples for Web Api and I do not know if there is a way to return a Vi ...
I have the following code in a class that implements IAsyncActionFilter using .Net Core. This line: produces the following error fail: Mi ...
I was wondering how can I check if a Controller Method has a certain attribute, for example AllowAnonymous, inside OnActionExecuting override method. ...
I'm overriding OnActionExecuting method in order to perform some checks before calling some controllers' methods and I was wondering if there was any ...
We have an MVC.NET Core Web API app which uses an action filter to validate the controller's methods' arguments. For validation we use FluentValidati ...
I have an .NET 4.5.2 application with localized resource files (Messages.resx (for pt), Messages.es.resx and Messages.en.resx). An MVC filter sets th ...
We have an ASP.NET application. We cannot edit source code of controllers. But we can implement ActionFilter. One of our controller action methods re ...
I have a MVC5 Web Application. I used Compression Filter on my controller from This Site Everything works but looks like still my page is not compres ...
I've tried creating an easy filter to see if the user is in a role called "System Administrator", basically short hand for having to do [Authorize(Rol ...
I want to implement a custom Content-Type validation filter so that a custom error model on a 415 Unsupported Media Type can be provided. Something ...
Want to retrieve the variable value of action into customized filter Controller : ...
I have the following custom filter, borrowed from this answer: Yet when I try and post to an action marked with [HttpGet], e.g. I get a standard ...
I have written a custom Authorize Filter: This filter has various conditions and in the end will set the result to Unauthorized, if the user is not ...
I have a default CustomAuthorizeAttribute defined in my Web Api project. However I have a special Controller where I would like to use a SpecialAu ...
I'm using custom filter that check user access permission to specific Action and I have area called Admin. When filter redirect unauthorized user, its ...