Introducing Web Development Using Controllers
This book is about mature and proven web development with .NET. This means a set of technologies that have been refined over a decade or more with plenty of documentation, support forums, and third-party investment.
These technologies are:
- ASP.NET Core: A set of shared components for building websites and services.
- ASP.NET Core MVC: An implementation of the model-view-controller design pattern for complex yet well-structured website development.
- ASP.NET Core Web APIs: For building controller-based web services that conform to the HTTP/REST service conventions.
- ASP.NET Core OData: For building data access web services using an open standard.
- Umbraco CMS: A third-party, open source, Content Management System (CMS) platform built on ASP.NET Core.
With these technologies, you will learn how to build cross-platform websites and web services using .NET 8 or .NET 9, the two actively supported versions of .NET.
You can choose either because some of the newer features that we will learn about, like the HybridCache
class, have backward compatibility with .NET 8. Others, like the new MapStaticAssets
method that optimizes files like stylesheets and JavaScript, only work with .NET 9. I will warn you in these cases.
The benefit of choosing .NET 8 is that it is a Long-Term Support (LTS) release, meaning it is supported for three years. .NET 8 will reach its end of life in November 2026.
The benefit of choosing the latest .NET 9 is significant performance improvements and better support for containerization for cloud hosting compared to earlier versions. .NET 9 will reach its end of life in May 2026.
Throughout this book, I use the term modern .NET to refer to .NET 9 and its predecessors, like .NET 6, that derive from .NET Core. I use the term legacy .NET to refer to .NET Framework, Mono, Xamarin, and .NET Standard. Modern .NET is a unification of those legacy platforms and standards.
Who are you? While writing this book, I have assumed that you are a .NET developer who is employed by a consultancy or a large organization. As such, you primarily work with mature and proven technologies like MVC rather that the newest shiny technologies pushed by Microsoft like Blazor. I also assume that you have little professional interest in being a web designer or content editor.
I recommend that you work through this and subsequent chapters sequentially because later chapters will reference projects in earlier chapters, and you will build up sufficient knowledge and skills to tackle the more challenging problems in later chapters. For example, the last section in this chapter will walk you through creating a pair of class libraries that define a database entity model that will be used in all subsequent chapters.
In this chapter, we will cover the following topics:
- Understanding ASP.NET Core
- Structuring projects and managing packages
- Making good use of the GitHub repository for this book
- Building an entity model for use in the rest of the book
Warning! Prerequisites for this book are knowledge of C# and .NET fundamentals, and I assume you have already set up your development environment to use Visual Studio 2022, Visual Studio Code, or JetBrains Rider. Throughout this book, I will use the names Visual Studio, VS Code, and Rider to refer to these three code editors respectively. If you have not set up your development environment, then you can learn how at the following link:
https://github.com/markjprice/web-dev-net9/blob/main/docs/ch01-setup-dev-env.md