Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ASP.NET 8 Best Practices

You're reading from   ASP.NET 8 Best Practices Explore techniques, patterns, and practices to develop effective large-scale .NET web apps

Arrow left icon
Product type Paperback
Published in Dec 2023
Publisher Packt
ISBN-13 9781837632121
Length 256 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jonathan R. Danylko Jonathan R. Danylko
Author Profile Icon Jonathan R. Danylko
Jonathan R. Danylko
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Chapter 1: Taking Control with Source Control 2. Chapter 2: CI/CD – Building Quality Software Automatically FREE CHAPTER 3. Chapter 3: Best Approaches for Middleware 4. Chapter 4: Applying Security from the Start 5. Chapter 5: Optimizing Data Access with Entity Framework Core 6. Chapter 6: Best Practices with Web User Interfaces 7. Chapter 7: Testing Your Code 8. Chapter 8: Catching Exceptions with Exception Handling 9. Chapter 9: Creating Better Web APIs 10. Chapter 10: Push Your Application with Performance 11. Chapter 11: Appendix 12. Index 13. Other Books You May Enjoy

What this book covers

Chapter 1, Taking Control with Source Control, addresses why source control is important, identifying and selecting a branching workflow, why tags are important, and proper commit etiquette.

Chapter 2, CI/CD – Building Quality Software Automatically, defines what CI/CD is, understanding and preparing code for a pipeline along with identifying two “falling” approaches when errors appear, how to deploy databases, and the various types of CI/CD providers, such as Azure, AWS, and Google Cloud Platform.

Chapter 3, Best Approaches for Middleware, explains what middleware is and how to optimize a middleware pipeline, using request delegates and extension methods, along with building an example middleware component.

Chapter 4, Applying Security from the Start, covers why security should be a top concern before, during, and after writing code, as well as common security practices. The chapter concludes by addressing the top three security threats on the internet.

Chapter 5, Optimizing Data Access with Entity Framework Core, looks at the different types of implementations of Entity Framework and how each one is used, why logging and async/await is important, how to use resources for large seed data, and why sometimes it’s better to bypass LINQ and use stored procedures.

Chapter 6, Best Practices for Web User Interfaces, examines what a task runner is, why they’re important, and how to create a workflow using one, along with reviewing UI standards such as centralizing site URLs, why controllers/pages should be small, why ViewComponents are beneficial, and how to create SEO-friendly URLs.

Chapter 7, Testing Your Code, explains the various types of testing concepts used in ASP.NET applications, why writing unit tests is important, why “100% test coverage” isn’t necessary, how to properly structure your unit tests with the triple-A approach (AAA), when to avoid writing extra unit test helpers, and how to use tests as documentation.

Chapter 8, Catching Exceptions with Exception Handling, reviews the different types of exception handling, how and when to use exception handling, and using global exception handling. It also covers logging, how unit testing and exceptional handling are similar, why empty try..catch blocks are wasteful, how to use exception filtering and pattern matching, and knowing when to use finally blocks.

Chapter 9, Creating Better Web APIs, demonstrates various practical API techniques, such as designing, creating, and testing APIs quickly, along with applying the right HTTP verbs and status codes to an API, how to implement a pagination structure, versioning, and DTOs into your APIs, and why creating a new HttpClient should be avoided.

Chapter 10, Push Your Application with Performance, takes everything we’ve learned throughout the chapters and applies a performance perspective to it. We’ll cover why performance is so important and why it matters, how to establish client, C# code, and database baselines, along with image optimization, minimizing requests, using CDNs, implementing async/await, how to automatically optimize HTML, Entity Framework Core optimizations, and caching strategies.

Chapter 11, Appendix, will review the fundamental terms used throughout the industry, such as the DRY, YAGNI, KISS principles, along with separation of concerns, how to refactor code, understanding the SOLID principles, and how to structure various project types in Visual Studio.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image