Customizing ASP.NET Core 6.0: Learn to turn the right screws to optimize your ASP.NET Core applications for better performance, 2nd Edition
- Length: 323 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2022-02-09
- ISBN-10: 1803233605
- ISBN-13: 9781803233604
- Sales Rank: #649531 (See Top 100 Books)
Explore hidden behaviors and customization techniques to help you get the most out of ASP.NET Core for building web applications
Key Features
- Second edition updated and enhanced to cover the latest .NET 6 features and changes
- Learn expert techniques to implement authentication and authorization for securing your web apps
- Discover best practices for configuring ASP.NET Core, from user interface design to hosting it on platforms
Book Description
ASP.NET Core comes packed full of hidden features for building sophisticated web applications. You’d be missing out on a lot of its capabilities by not customizing it to work for your applications. With Customizing ASP.NET Core 6.0, you’ll discover techniques to help you get the most out of the framework to deliver robust applications.
In this updated second edition, you’ll cover the latest features and changes in the .NET 6 LTS version. You’ll find new insights and customization techniques for important topics such as authentication and authorization. The book will also show you how to work with caches and change the default behavior of ASP.NET Core apps. You’ll learn essential concepts relating to optimizing the framework such as configuration, dependency injection, routing, action filters, and more. As you progress, you’ll be able to create custom solutions that meet the needs of your use case with ASP.NET Core. Later chapters will cover expert techniques and best practices for using the framework for your app development needs, from UI design to hosting. Finally, you’ll focus on the new endpoint routing in ASP.NET Core to build custom endpoints and add third-party endpoints to your web apps for processing requests faster.
By the end of this book, you’ll be able to customize ASP.NET Core to develop robust optimized apps.
What you will learn
- Explore various application configurations and providers in ASP.NET Core 6
- Enable and work with caches to improve the performance of your application
- Understand dependency injection in .NET and learn how to add third-party DI containers
- Discover the concept of middleware and write your middleware for ASP.NET Core apps
- Create various API output formats in your API-driven projects
- Get familiar with different hosting models for your ASP.NET Core app
Who This Book Is For
This .NET 6 book is for .NET developers who need to change the default behaviors of the framework to help improve the performance of their applications. Intermediate-level knowledge of ASP.NET Core and C# is required before getting started with the book.
Table of Contents
- Customizing Logging
- Customizing App Configuration
- Customizing Dependency Injection
- Configuring and Customizing HTTPS
- Configuring WebHostBuilder
- Using different Hosting models
- Using IHostedService and BackgroundService
- Writing Custom Middleware
- Working with Endpoint Routing
- Customizing ASP.NET Core Identity
- Configuring Identity Management
- Content Negotiation Using a Custom OutputFormatter
- Managing Inputs with Custom ModelBinders
- Creating custom ActionFilter
- Working with Caches
- Creating custom TagHelpers
Customizing ASP.NET Core 6.0 Second Edition Foreword Contributors About the author About the reviewer Preface ASP.NET Core architecture overview What is covered in this book? What is not covered and why? Who this book is for What this book covers To get the most out of this book Download the example code files Download the color images Conventions used Get in touch Share Your Thoughts Chapter 1: Customizing Logging Technical requirements Configuring logging Creating a custom logger Plugging in an existing third-party logger provider Summary Chapter 2: Customizing App Configuration Technical requirements Configuring the configuration Using typed configurations Configuration using INI files Configuration providers Summary Further reading Chapter 3: Customizing Dependency Injection Technical requirements Using a different DI container Exploring the ConfigureServices method Using a different ServiceProvider Introducing Scrutor Summary Chapter 4: Configuring and Customizing HTTPS with Kestrel Technical requirements Introducing Kestrel Setting up Kestrel For your safety Summary Chapter 5: Configuring WebHostBuilder Technical requirements Re-examining WebHostBuilderContext How does it work? Summary Further reading Chapter 6: Using Different Hosting Models Technical requirements Setting up WebHostBuilder Setting up Kestrel Setting up HTTP.sys Hosting on IIS Using Nginx or Apache on Linux Configuring Nginx Configuring Apache Summary Further reading Chapter 7: Using IHostedService and BackgroundService Technical requirements Introducing IHostedService Introducing BackgroundService Implementing the new Worker Service projects Summary Chapter 8: Writing Custom Middleware Technical requirements Introducing middleware Writing custom middleware Exploring the potential of middleware Branching the pipeline with /map Branching the pipeline with MapWhen() Creating conditions with middleware Using middleware in ASP.NET Core 3.0 and later Rewriting terminating middleware to meet the current standards Summary Chapter 9: Working with Endpoint Routing Technical requirements Exploring endpoint routing Creating custom endpoints Creating a more complex endpoint Summary Chapter 10: Customizing ASP.NET Core Identity Technical requirements Introducing ASP.NET Core Identity Customizing IdentityUser Customizing the Identity views Summary Chapter 11: Configuring Identity Management Technical requirements Introducing IdentityManager2 Setting up IdentityManager2 Securing IdentityManager2 Summary Chapter 12: Content Negotiation Using a Custom OutputFormatter Technical requirements Introducing OutputFormatter objects Preparing a test project Testing the web API Creating custom OutputFormatter objects Summary Chapter 13: Managing Inputs with Custom ModelBinder Technical requirements Introducing ModelBinder Preparing the test data Preparing the test project Creating PersonsCsvBinder Using ModelBinder Testing ModelBinder Summary Further reading Chapter 14: Creating a Custom ActionFilter Technical requirements Introducing ActionFilter Using ActionFilter Summary Further reading Chapter 15: Working with Caches Technical requirements Why do we need caching? HTTP-based caching Caching using ResponseCachingMiddleware Predefining caching strategies using cache profiles Caching specific areas using CacheTagHelper Caching Manually Summary Further reading Chapter 16: Creating Custom TagHelper Technical requirements Introducing TagHelper Creating custom Tag Helpers Examining a more complex scenario Summary Further reading Why subscribe? Other Books You May Enjoy Packt is searching for authors like you Share Your Thoughts
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Customizing ASP.NET Core 6.0: Learn to turn the right screws to optimize your ASP.NET Core applications for better performance, 2nd Edition
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.