The Microsoft .NET dependency injection library extension for the official unofficial .NET NHL API 🏒
An extension for the Nhl.Api to easily add the Nhl.Api library to any .NET project using the built in .NET dependency injection library
You should install Nhl.Api.Extensions.Microsoft.DependencyInjection with NuGet:
Install-Package Nhl.Api.Extensions.Microsoft.DependencyInjection
Or via the .NET Core command line interface:
dotnet add package Nhl.Api.Extensions.Microsoft.DependencyInjection
Using and implementing the Nhl.Api dependency injection extension is as simple as one line on C# code ⌨️
builder.Services.AddNhlApi();
You can also use a method parameter to specify the type of dependency life time
builder.Services.AddNhlApi(serviceLifetime: ServiceLifetime.Singleton);
builder.Services.AddNhlApi(serviceLifetime: ServiceLifetime.Transient);
builder.Services.AddNhlApi(serviceLifetime: ServiceLifetime.Scoped);
If you have any issues with the library or suggestions, please feel free to create an issue and it will be adressed as soon as possible :)