Understanding the basics of ASP.NET Core
ASP.NET Core is based on the concept of the generic host, as explained in the Using generic hosts subsection of Chapter 5, Applying a Microservice Architecture to Your Enterprise Application. The basic architecture of ASP.NET Core was outlined in the A short introduction to ASP.NET Core subsection of Chapter 13, Applying Service-Oriented Architectures with .NET.
It is worth reminding that the host configuration consists mainly in adding services to the Dependency Injection (DI) application through the Services
property of a host builder instance whose type implements the IServiceCollection
interface:
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddTransient<IMyService, MyService>();
...
// Add services to the container through extension methods.
builder.Services.AddControllersWithViews();
builder.Services.AddAllQueries(typeof(ManagePackagesController).Assembly);
...
......