In this chapter, we saw that in general, the asynchronous versions of each filter method are preferred because they are inherently more scalable—a thread does not block while filters are being invoked—and also that on the same class, threads do not mix the synchronous and asynchronous versions of a filter interface because only the asynchronous version is called. It is best notto mix synchronous and asynchronous filters at all! In this section, we also saw what the filter types are based on.
An important observation is that we can use the DI through the [ServiceFilter] attribute if we need to inject dependencies into our filters. For global filters, add the filter type to the MvcOptions.Filters collection in AddMvc, rather than a filter instance.
Then, we saw that we need to be aware of each filter's intended purpose and not use a resource filter for authorization. Use action filters if you need to intercept action parameters...