A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/blob/master below:

GitHub - seesharper/LightInject.Microsoft.DependencyInjection: Implements Microsoft.Extensions.DependencyInjection.Abstraction

LightInject.Microsoft.DependencyInjection

Implements the Microsoft.Extensions.DependencyInjection.Abstractions and makes it possible to create an IServiceProvider that is 100% compatible with the Microsoft.Extensions.DependencyInjection.Specification.Tests.

Note: This package is NOT meant to be used directly with AspNetCore applications. If the target application is an AspNetCore application, use the LightInject.Microsoft.Hosting package instead.

dotnet add package LightInject.Microsoft.DependencyInjection
var services = new ServiceCollection();
services.AddTransient<Foo>();
var provider = services.CreateLightInjectServiceProvider();

It is also possible to create an IServiceProvider directly from an IServiceContainer instance.

var container = new ServiceContainer(Options.Default.WithMicrosoftSettings);
var provider = container.CreateServiceProvider();

Note: Make sure that the Options.Default.WithMicrosoftSettings is passed in as options when creating the container. This makes the provider compliant with the default provider from Microsoft.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4