├── .vscode
├── settings.json
├── launch.json
└── tasks.json
├── packlocal.sh
├── omnisharp.json
├── src
├── LightInject.Microsoft.DependencyInjection.Benchmarks
│ ├── Program.cs
│ ├── LightInject.Microsoft.DependencyInjection.Benchmarks.csproj
│ ├── SingletonBenchmarks.cs
│ ├── Singleton.cs
│ ├── ScopedService.cs
│ ├── BeginScopeBenchmarks.cs
│ ├── TestController.cs
│ └── RepositoryTransients.cs
├── LightInject.Microsoft.DependencyInjection.Tests
│ ├── LightInjectSpecificationTests.cs
│ ├── LightInjectSpecificationTestsWithCurrentScopeEnabled.cs
│ ├── LightInject.Microsoft.DependencyInjection.Tests.csproj
│ ├── ServiceCollectionTests.cs
│ ├── AsyncDisposableTests.cs
│ ├── DefaultServiceTests.cs
│ ├── ServiceProviderFactoryTests.cs
│ ├── LightInjectKeyedSpecificationTests.cs
│ └── ServiceContainerTests.cs
└── LightInject.Microsoft.DependencyInjection
│ ├── LightInject.Microsoft.DependencyInjection.csproj
│ └── LightInject.Microsoft.DependencyInjection.cs
├── .github
└── workflows
│ └── main.yml
├── license.md
├── readme.md
├── CHANGELOG.md
├── .gitattributes
├── LightInject.Microsoft.DependencyInjection.sln
├── .gitignore
└── .idea
└── .idea.LightInject.Microsoft.DependencyInjection
└── .idea
└── workspace.xml
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "coverage-gutters.lcovname": "../build/Artifacts/TestCoverage/coverage.info",
3 | "cSpell.words": [
4 | "Xunit"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/packlocal.sh:
--------------------------------------------------------------------------------
1 | dotnet pack "src/LightInject.Microsoft.DependencyInjection/LightInject.Microsoft.DependencyInjection.csproj" --configuration Release --output "build/Artifacts/NuGet" /property:Version=$1
2 |
--------------------------------------------------------------------------------
/omnisharp.json:
--------------------------------------------------------------------------------
1 | {
2 | "FormattingOptions": {
3 | "EnableEditorConfigSupport": true,
4 | "OrganizeImports": true
5 | },
6 | "RoslynExtensionsOptions": {
7 | "EnableAnalyzersSupport": true,
8 | "EnableDecompilationSupport": true
9 | },
10 | "script": {
11 | "enableScriptNuGetReferences": true,
12 | "defaultTargetFramework": "net8.0"
13 | }
14 | }
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Benchmarks/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Attributes;
3 | using BenchmarkDotNet.Configs;
4 | using BenchmarkDotNet.Running;
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace LightInject.Benchmarks
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Tests/LightInjectSpecificationTests.cs:
--------------------------------------------------------------------------------
1 | namespace LightInject.Microsoft.DependencyInjection.Tests
2 | {
3 | using System;
4 | using global::Microsoft.Extensions.DependencyInjection;
5 | using global::Microsoft.Extensions.DependencyInjection.Specification;
6 |
7 | public class LightInjectSpecificationTests : DependencyInjectionSpecificationTests
8 | {
9 | protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection)
10 | {
11 | return serviceCollection.CreateLightInjectServiceProvider(new ContainerOptions() { EnableCurrentScope = false });
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Tests/LightInjectSpecificationTestsWithCurrentScopeEnabled.cs:
--------------------------------------------------------------------------------
1 | namespace LightInject.Microsoft.DependencyInjection.Tests
2 | {
3 | using System;
4 | using global::Microsoft.Extensions.DependencyInjection;
5 | using global::Microsoft.Extensions.DependencyInjection.Specification;
6 |
7 | public class LightInjectSpecificationTestsWithCurrentScopeEnabled : DependencyInjectionSpecificationTests
8 | {
9 | protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection)
10 | {
11 | return serviceCollection.CreateLightInjectServiceProvider(new ContainerOptions() { EnableCurrentScope = true });
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - uses: actions/checkout@v1
11 | - name: Install .Net Core
12 | uses: actions/setup-dotnet@v2.0.0
13 | with:
14 | dotnet-version: 8.0.x
15 | - name: Install dotnet-script
16 | run: dotnet tool install dotnet-script --tool-path dotnet-script-tool
17 |
18 | - name: Run build script
19 | run: dotnet-script-tool/dotnet-script build/build.csx
20 | env: # Or as an environment variable
21 | GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 | IS_SECURE_BUILDENVIRONMENT: ${{ secrets.IS_SECURE_BUILDENVIRONMENT }}
23 | NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
24 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Benchmarks/LightInject.Microsoft.DependencyInjection.Benchmarks.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | false
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/license.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Bernhard Richter
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Benchmarks/SingletonBenchmarks.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BenchmarkDotNet.Attributes;
3 | using Microsoft.Extensions.DependencyInjection;
4 |
5 | namespace LightInject.Microsoft.DependencyInjection.Benchmarks
6 | {
7 | public class SingletonBenchmarks
8 | {
9 | private IServiceProvider lightInjectServiceProvider;
10 | private IServiceProvider defaultServiceProvider;
11 |
12 | [GlobalSetup]
13 | public void Setup()
14 | {
15 | var serviceCollection = new ServiceCollection();
16 | serviceCollection.AddSingleton();
17 |
18 | lightInjectServiceProvider = serviceCollection.CreateLightInjectServiceProvider();
19 | defaultServiceProvider = serviceCollection.BuildServiceProvider();
20 | }
21 |
22 | [Benchmark]
23 | public void UsingLightInject()
24 | {
25 | var instance = lightInjectServiceProvider.GetService();
26 | }
27 |
28 | [Benchmark]
29 | public void UsingMicrosoft()
30 | {
31 | var instance = defaultServiceProvider.GetService();
32 | }
33 |
34 | }
35 | }
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Tests/LightInject.Microsoft.DependencyInjection.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 |
6 |
7 |
8 | runtime; build; native; contentfiles; analyzers; buildtransitive
9 | all
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | all
18 | runtime; build; native; contentfiles; analyzers
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/src/LightInject.Microsoft.DependencyInjection.Benchmarks/bin/Debug/netcoreapp2.2/LightInject.Microsoft.DependencyInjection.Benchmarks.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/LightInject.Microsoft.DependencyInjection.Benchmarks",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "externalTerminal",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach",
24 | "processId": "${command:pickProcess}"
25 | },
26 | {
27 | "name": ".NET Script Debug",
28 | "type": "coreclr",
29 | "request": "launch",
30 | "program": "${env:HOME}/.dotnet/tools/dotnet-script",
31 | "args": [
32 | "${file}"
33 | ],
34 | "windows": {
35 | "program": "${env:USERPROFILE}/.dotnet/tools/dotnet-script.exe",
36 | },
37 | "cwd": "${workspaceFolder}",
38 | "stopAtEntry": true,
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Tests/ServiceCollectionTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Text;
4 | using Microsoft.Extensions.DependencyInjection;
5 | using Xunit;
6 |
7 | namespace LightInject.Microsoft.DependencyInjection.Tests
8 | {
9 | public class ServiceCollectionTests
10 | {
11 | [Fact]
12 | public void ShouldCreateServiceProviderFromServiceCollection()
13 | {
14 | var serviceCollection = new ServiceCollection();
15 | var provider = serviceCollection.CreateLightInjectServiceProvider();
16 | Assert.IsAssignableFrom(provider);
17 | }
18 |
19 | [Fact]
20 | public void ShouldCreateServiceProviderWithOptionsFromServiceCollection()
21 | {
22 | StringBuilder log = new StringBuilder();
23 | ContainerOptions.Default.LogFactory = (t) => l => log.AppendLine(l.Message);
24 |
25 | var serviceCollection = new ServiceCollection();
26 | serviceCollection.AddSingleton("42");
27 | var provider = serviceCollection.CreateLightInjectServiceProvider();
28 | var instance = provider.GetService();
29 | Assert.IsAssignableFrom(provider);
30 |
31 | Assert.NotEmpty(log.ToString());
32 | }
33 |
34 | [Fact]
35 | public void ShouldSupportNonRuntimeTypeFactoryRegistrations()
36 | {
37 | var serviceCollection = new ServiceCollection();
38 | serviceCollection.AddSingleton(new TypeDelegator(typeof(int)), _ => 42);
39 | Assert.NotNull(serviceCollection.CreateLightInjectServiceProvider());
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection/LightInject.Microsoft.DependencyInjection.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0;netstandard2.0
5 | Bernhard Richter
6 | Enables LightInject to be used as the service container in ASP.NET Core and Entity Framework 7 applications.
7 | Bernhard Richter
8 | http://opensource.org/licenses/MIT
9 |
10 | https://github.com/seesharper/LightInject.Microsoft.DependencyInjection
11 | git
12 | Ioc Dependency-Injection Inversion-of-Control LightInject ASP.NET Entity-Framework
13 | true
14 | portable
15 | true
16 | true
17 | true
18 | latest
19 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
20 |
21 |
22 |
23 |
24 |
25 | all
26 | runtime; build; native; contentfiles; analyzers
27 |
28 |
29 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # LightInject.Microsoft.DependencyInjection
2 | [](https://ci.appveyor.com/project/seesharper/lightinject-microsoft-dependencyinjection)
3 | []()
4 | []()
5 |
6 | Implements the [Microsoft.Extensions.DependencyInjection.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/) and makes it possible to create an `IServiceProvider` that is 100% compatible with the [Microsoft.Extensions.DependencyInjection.Specification.Tests](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Specification.Tests).
7 |
8 | > 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](https://www.nuget.org/packages/LightInject.Microsoft.Hosting/) package instead.
9 |
10 | ## Installing
11 |
12 | ```shell
13 | dotnet add package LightInject.Microsoft.DependencyInjection
14 | ```
15 |
16 | ## Usage
17 | ```c#
18 | var services = new ServiceCollection();
19 | services.AddTransient();
20 | var provider = services.CreateLightInjectServiceProvider();
21 | ```
22 |
23 | It is also possible to create an `IServiceProvider` directly from an `IServiceContainer` instance.
24 |
25 | ```c#
26 | var container = new ServiceContainer(Options.Default.WithMicrosoftSettings);
27 | var provider = container.CreateServiceProvider();
28 | ```
29 |
30 | > 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.
31 |
32 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "args": [
8 | "build",
9 | "/property:GenerateFullPaths=true"
10 | ],
11 | "type": "shell",
12 | "options": {
13 | "cwd": "${workspaceFolder}"
14 | },
15 | "group": "build",
16 | "presentation": {
17 | "reveal": "always"
18 | },
19 | "problemMatcher": "$msCompile"
20 | },
21 | {
22 | "label": "rebuild",
23 | "command": "dotnet",
24 | "args": [
25 | "build",
26 | "--no-incremental",
27 | "/property:GenerateFullPaths=true"
28 | ],
29 | "type": "shell",
30 | "options": {
31 | "cwd": "${workspaceFolder}"
32 | },
33 | "group": "build",
34 | "presentation": {
35 | "reveal": "always",
36 | "clear": true
37 | },
38 | "problemMatcher": "$msCompile"
39 | },
40 | {
41 | "label": "test",
42 | "command": "dotnet",
43 | "type": "process",
44 | "args": [
45 | "script",
46 | "${workspaceFolder}/build/build.csx",
47 | "test"
48 | ],
49 | "problemMatcher": "$msCompile",
50 | "group": {
51 | "kind": "test",
52 | "isDefault": true
53 | },
54 | "presentation": {
55 | "echo": true,
56 | "reveal": "always",
57 | "focus": false,
58 | "panel": "shared",
59 | "showReuseMessage": true,
60 | "clear": true
61 | }
62 | },
63 | {
64 | "label": "test with coverage",
65 | "command": "dotnet",
66 | "type": "process",
67 | "args": [
68 | "script",
69 | "${workspaceFolder}/build/build.csx",
70 | "testcoverage"
71 | ],
72 | "problemMatcher": "$msCompile",
73 | "group": {
74 | "kind": "test",
75 | "isDefault": true
76 | }
77 | }
78 | ]
79 | }
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ## [v1.1.0](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/tree/v1.1.0) (2016-08-30)
4 | [Full Changelog](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/compare/v1.0.1...v1.1.0)
5 |
6 | **Closed issues:**
7 |
8 | - Implement explicit registration of enumerable services to ensure deterministic ordering of services [\#3](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/issues/3)
9 |
10 | **Merged pull requests:**
11 |
12 | - Updated to 4.1.0 [\#5](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/pull/5) ([geirsagberg](https://github.com/geirsagberg))
13 |
14 | ## [v1.0.1](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/tree/v1.0.1) (2016-07-05)
15 | [Full Changelog](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/compare/v1.0.1-rc2-2...v1.0.1)
16 |
17 | ## [v1.0.1-rc2-2](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/tree/v1.0.1-rc2-2) (2016-05-31)
18 | [Full Changelog](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/compare/v1.0.2-rc2...v1.0.1-rc2-2)
19 |
20 | **Closed issues:**
21 |
22 | - Update to RC2 and build with dotnet [\#2](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/issues/2)
23 |
24 | ## [v1.0.2-rc2](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/tree/v1.0.2-rc2) (2016-05-20)
25 | [Full Changelog](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/compare/v1.0.1-rc2...v1.0.2-rc2)
26 |
27 | **Closed issues:**
28 |
29 | - Use PerContainerScopeManager [\#1](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/issues/1)
30 |
31 | ## [v1.0.1-rc2](https://github.com/seesharper/LightInject.Microsoft.DependencyInjection/tree/v1.0.1-rc2) (2016-01-28)
32 |
33 |
34 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Benchmarks/Singleton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LightInject.Microsoft.DependencyInjection.Benchmarks
4 | {
5 |
6 | public interface ISingleton1
7 | {
8 | void DoSomething();
9 | }
10 |
11 |
12 | public interface ISingleton2
13 | {
14 | void DoSomething();
15 | }
16 |
17 |
18 | public interface ISingleton3
19 | {
20 | void DoSomething();
21 | }
22 |
23 | public class Singleton1 : ISingleton1
24 | {
25 | private static int counter;
26 |
27 | public Singleton1()
28 | {
29 | System.Threading.Interlocked.Increment(ref counter);
30 | }
31 |
32 | public static int Instances
33 | {
34 | get { return counter; }
35 | set { counter = value; }
36 | }
37 |
38 | public void DoSomething()
39 | {
40 | Console.WriteLine("Hello");
41 | }
42 | }
43 |
44 | public class Singleton2 : ISingleton2
45 | {
46 | private static int counter;
47 |
48 | public Singleton2()
49 | {
50 | System.Threading.Interlocked.Increment(ref counter);
51 | }
52 |
53 | public static int Instances
54 | {
55 | get { return counter; }
56 | set { counter = value; }
57 | }
58 |
59 | public void DoSomething()
60 | {
61 | Console.WriteLine("Hello");
62 | }
63 | }
64 |
65 | public class Singleton3 : ISingleton3
66 | {
67 | private static int counter;
68 |
69 | public Singleton3()
70 | {
71 | System.Threading.Interlocked.Increment(ref counter);
72 | }
73 |
74 | public static int Instances
75 | {
76 | get { return counter; }
77 | set { counter = value; }
78 | }
79 |
80 | public void DoSomething()
81 | {
82 | Console.WriteLine("Hello");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/LightInject.Microsoft.DependencyInjection.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30114.105
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{15856E1C-AB65-4DAA-8C57-3478DE8C8420}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightInject.Microsoft.DependencyInjection", "src\LightInject.Microsoft.DependencyInjection\LightInject.Microsoft.DependencyInjection.csproj", "{F66CEE6C-90B1-4BF8-80E0-5B2594819F59}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightInject.Microsoft.DependencyInjection.Tests", "src\LightInject.Microsoft.DependencyInjection.Tests\LightInject.Microsoft.DependencyInjection.Tests.csproj", "{8B4FA81E-8014-44D5-8FF1-09287630355C}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightInject.Microsoft.DependencyInjection.Benchmarks", "src\LightInject.Microsoft.DependencyInjection.Benchmarks\LightInject.Microsoft.DependencyInjection.Benchmarks.csproj", "{28EE4FC0-43BB-458A-B186-256207B660B5}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {F66CEE6C-90B1-4BF8-80E0-5B2594819F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {F66CEE6C-90B1-4BF8-80E0-5B2594819F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {F66CEE6C-90B1-4BF8-80E0-5B2594819F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {F66CEE6C-90B1-4BF8-80E0-5B2594819F59}.Release|Any CPU.Build.0 = Release|Any CPU
27 | {8B4FA81E-8014-44D5-8FF1-09287630355C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28 | {8B4FA81E-8014-44D5-8FF1-09287630355C}.Debug|Any CPU.Build.0 = Debug|Any CPU
29 | {8B4FA81E-8014-44D5-8FF1-09287630355C}.Release|Any CPU.ActiveCfg = Release|Any CPU
30 | {8B4FA81E-8014-44D5-8FF1-09287630355C}.Release|Any CPU.Build.0 = Release|Any CPU
31 | {28EE4FC0-43BB-458A-B186-256207B660B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {28EE4FC0-43BB-458A-B186-256207B660B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {28EE4FC0-43BB-458A-B186-256207B660B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 | {28EE4FC0-43BB-458A-B186-256207B660B5}.Release|Any CPU.Build.0 = Release|Any CPU
35 | EndGlobalSection
36 | GlobalSection(NestedProjects) = preSolution
37 | {F66CEE6C-90B1-4BF8-80E0-5B2594819F59} = {15856E1C-AB65-4DAA-8C57-3478DE8C8420}
38 | {8B4FA81E-8014-44D5-8FF1-09287630355C} = {15856E1C-AB65-4DAA-8C57-3478DE8C8420}
39 | {28EE4FC0-43BB-458A-B186-256207B660B5} = {15856E1C-AB65-4DAA-8C57-3478DE8C8420}
40 | EndGlobalSection
41 | EndGlobal
42 |
--------------------------------------------------------------------------------
/src/LightInject.Microsoft.DependencyInjection.Tests/AsyncDisposableTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using Microsoft.Extensions.DependencyInjection;
5 | using Xunit;
6 |
7 | namespace LightInject.Microsoft.DependencyInjection.Tests
8 | {
9 | public class AsyncDisposableTests
10 | {
11 | [Fact]
12 | public async Task ShouldDisposeAsyncDisposable()
13 | {
14 | var serviceCollection = new ServiceCollection();
15 | List