Wlvyr.Common.DI.SimpleInjector 0.2.2

dotnet add package Wlvyr.Common.DI.SimpleInjector --version 0.2.2
                    
NuGet\Install-Package Wlvyr.Common.DI.SimpleInjector -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wlvyr.Common.DI.SimpleInjector" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wlvyr.Common.DI.SimpleInjector" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Wlvyr.Common.DI.SimpleInjector" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wlvyr.Common.DI.SimpleInjector --version 0.2.2
                    
#r "nuget: Wlvyr.Common.DI.SimpleInjector, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wlvyr.Common.DI.SimpleInjector@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wlvyr.Common.DI.SimpleInjector&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Wlvyr.Common.DI.SimpleInjector&version=0.2.2
                    
Install as a Cake Tool

Wlvyr.Common.DI.SimpleInjector

Wlvyr.Common.DI.SimpleInjector is a helper library that simplifies common setup patterns and configurations for the SimpleInjector dependency injection container.

Usage

RegisterSingleton Extension Method

using Wlvyr.Common.Data.Configuration;
using Wlvyr.Common.DI.SimpleInjector;

var dbConfigProvider = new DatabaseConfigProviderBuilder(appSettings)
                            .Set...()
                            .Set...()
                            .build(); // or your own IDatabaseConfigProvider.

// Register  both IDatabaseConfigProvider and DatabaseExecutorFactory
container.RegisterSingleton<IDatabaseConfigProvider>(() => dbConfigProvider);
container.RegisterSingleton<IDatabaseExecutorFactory, DatabaseExecutorFactory>();

// Can use this afterwards.
container.RegisterRepository<ISomeRepository, SomeRepository>();
container.RegisterRepository<ISomRepository2, SomeRepository2>();

SomeRepository and SomeRepository2 expect an IDatabaseExecutor as a constructor parameter. Additionally, the extension method works only for repository constructors that have a single parameter of type IDatabaseExecutor.

SimpleInjectorBootstrapFactory

using Wlvyr.Common.Configuration;
using Wlvyr.Common.Reflection;
using Wlvyr.Common.DI.SimpleInjector;


var appSettings = new AppSettings(builder.Configuration);

var assemblies = AssemblyHelper.GetAssemblies(
                        nameIncludes: new HashSet<string>() {
                            // assemblies to include
                            // leave empty to include all
                        }
                 );
var excludedIDiConfigFullNames = new HashSet<string>() {
    // IDIConfig to exclude.
};

var diBootstrap = SimpleInjectorBootstrapFactory.CreateBootstrap(
                                assemblies,
                                appSettings,
                                excludedIDiConfigFullNames
                                );
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 119 7/9/2026
0.2.1 172 1/1/2026

- **0.2.2**: Bumped Wlvyr.Common dependency to 0.3.0
      - **0.2.1**: Updated project metadata and documentation
      - **0.2.0**: Added SimpleInjectorBootstrapFactory.CreateBootstrap to simplify bootstrap creation process.