Summary
In this chapter, we have gained a solid understanding of the Middleware pipeline, its components, and best practices for using Middleware in ASP.NET Core. We also learned about common practices when using Middleware, such as always using asynchronous methods, prioritizing the order, consolidating your Middleware components into groups, and encapsulating your Middleware into classes. Knowing these Middleware concepts is key to creating maintainable and readable code.
Finally, we finished the chapter by creating a simple component to replace text with an image in a stream for the user.
In the next chapter, we’ll begin looking at applying security to new and existing applications.