ENGLISH

Customizing ASP.NET Core 5.0: Turn the right screws in ASP.NET Core to get the most out of the framework

Book information

Publisher
Packt Publishing
Year
2021
ISBN
180107786X, 9781801077866
Language
english
Format
PDF
Filesize
6 MB (6314435 bytes)
Pages
160\161
Time added
2021-11-20 11:40:33

Description

A guide to discovering the hidden behaviors of ASP.NET Core that can be customized to optimize your .NET 5 applications Key FeaturesCustomize the default behavior of ASP.NET Core to get the most out of the frameworkEnhance the app configuration, change the default dependency injection, and build your own tag helpersDiscover best practices for configuring ASP.NET Core, from user interface design to hosting it on platformsBook Description ASP.NET Core is the most powerful Microsoft web framework. Although it's full of rich features, sometimes the default configurations can be a bottleneck and need to be customized to suit the nature and scale of your app. If you're an intermediate-level .NET developer who wants to extend .NET Core to multiple use cases, it's important to customize these features so that the framework works for you effectively. Customizing ASP.NET Core 5.0 covers core features that can be customized for developing optimized apps. The customization techniques are also updated to work with the latest .NET 5 framework. 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 application development book, you'll have the skills you need to be able to customize ASP.NET Core to develop robust optimized apps. What you will learnExplore various application configurations and providers in ASP.NET Core 5Understand dependency injection in .NET and learn how to add third-party DI containersDiscover the concept of middleware and write your own middleware for ASP.NET Core appsCreate various API output formats in your API-driven projectsGet familiar with different hosting models for your ASP.NET Core appDevelop custom routing endpoints and add third-party endpointsConfigure WebHostBuilder effectively for your web applicationsWho this book is for This .NET 5 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 ContentsCustomizing LoggingCustomizing App ConfigurationCustomizing Dependency InjectionConfiguring and Customizing HTTPS with KestrelUsing IHostedService and BackgroundServiceWriting Custom MiddlewareContent Negotiation Using a Custom OutputFormatterManaging Inputs with Custom ModelBindersCreating a Custom ActionFilterCreating Custom TagHelpersConfiguring WebHostBuilderUsing Different Hosting ModelsWorking with Endpoint Routing Cover Title page Copyright and Credits Dedication About Packt Foreword Contributors Table of Contents Preface 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 dependency injection container Looking at the ConfigureServices method Using a different ServiceProvider type Registering dependencies with ConfigureContainer Introducing Scrutor Summary Chapter 4: Configuring and Customizing HTTPS with Kestrel Technical requirements Introducing Kestrel Setting up Kestrel For your safety Summary Chapter 5: Using IHostedService and BackgroundService Technical requirements Introducing IHostedService Introducing BackgroundService Implementing the new Worker Service projects Summary Chapter 6: Writing Custom Middleware Technical requirements Introducing middleware Writing a custom middleware Exploring the potential of middleware Branching the pipeline with /map Branching the pipeline with MapWhen() Creating conditions with middleware Using middleware on ASP.NET Core 3.0 and later Rewriting a terminating middleware to current standards Summary Chapter 7: Content Negotiation Using a Custom OutputFormatter Technical requirements Introducing OutputFormatters Preparing a test project Testing the Web API Creating custom OutputFormatters Summary Chapter 8: Managing Inputs with Custom ModelBinders Technical requirements Introducing ModelBinders Preparing the test data Preparing the test project Creating PersonsCsvBinder Using ModelBinder Testing ModelBinder Summary Further reading Chapter 9: Creating a Custom ActionFilter Technical requirements Introducing ActionFilters Using ActionFilters Summary Further reading Chapter 10: Creating Custom TagHelpers Technical requirements Introducing TagHelpers Creating custom TagHelpers Examining a more complex scenario Summary Further reading Chapter 11: Configuring WebHostBuilder Technical requirements Re-examining WebHostBuilderContext How does it work? Summary Chapter 12: 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 13: Working with Endpoint Routing Technical requirements Exploring endpoint routing Creating custom endpoints Creating a more complex endpoint Summary Other Books You May Enjoy Index

Similar books

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

2010 · PDF

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

1858 · PDF