Skip to content
Implements Microsoft.Extensions.DependencyInjection.Abstraction
C#
Branch: master
Clone or download

Latest commit

seesharper Merge pull request #128 from seesharper/dependabot/nuget/src/LightInj…
…ect-6.3.3

Bump LightInject from 6.3.2 to 6.3.3 in /src
Latest commit 1cabb47 May 13, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
build
src Bump LightInject from 6.3.2 to 6.3.3 in /src May 13, 2020
.gitattributes
.gitignore Ignore global tool Oct 20, 2019
CHANGELOG.md Added changelog Aug 30, 2016
readme.md Updated doc Feb 12, 2020

readme.md

LightInject.Microsoft.DependencyInjection

AppVeyor NuGet GitHub tag

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.

Installing

dotnet add package LightInject.Microsoft.DependencyInjection

Usage

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.

You can’t perform that action at this time.