Skip to main content

Hosting

An Awaiten container runs on its own: create the root and resolve from it. ASP.NET Core, the generic host and worker services expect Microsoft.Extensions.DependencyInjection (MS.DI) instead. The Awaiten.Extensions.DependencyInjection package hands your container to the host, and imported services let your container use what the host registers, such as its logger or configuration.

Pick the page for your task​

You want toExplained on
Hand your container to ASP.NET Core or the generic hostMS.DI bridge
Use services that the host registers inside your Awaiten graphExternal services
Move an existing IServiceCollection setup to Awaiten, at once or one service at a timeMigrating from MS.DI

Three ways to hand a container to the host​

The bridge offers three entry points. The MS.DI bridge compares them in detail.

  • AddAwaitenContainer adds the container to a service collection, such as builder.Services, next to the host's own registrations. It is also the way to migrate one group of services at a time.
  • AwaitenServiceProviderFactory fits a host that builds its provider through a factory.
  • AwaitenServiceProvider lets the container answer every request, when nothing but the container registers services.

Where to go next​