Skip to content

Intergrate with `Microsoft.Extensions.Hosting`

Kengwang edited this page Jan 29, 2024 · 1 revision

As Microsoft.Extensions.Hosting is being used commonly in projects (like ASP .NET Core), you can use Depository in those projects.

First, install package using nuget

dotnet add package Depository.Extensions.DependencyInjection

Then, add a line right after your builder

host.ConfigureContainer(new DepositoryServiceProviderFactory());
Clone this wiki locally