Hemel.DependencyInjection.TypedFactory 1.0.0-dev.3

This is a prerelease version of Hemel.DependencyInjection.TypedFactory.
dotnet add package Hemel.DependencyInjection.TypedFactory --version 1.0.0-dev.3
NuGet\Install-Package Hemel.DependencyInjection.TypedFactory -Version 1.0.0-dev.3
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="Hemel.DependencyInjection.TypedFactory" Version="1.0.0-dev.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hemel.DependencyInjection.TypedFactory --version 1.0.0-dev.3
#r "nuget: Hemel.DependencyInjection.TypedFactory, 1.0.0-dev.3"
#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.
// Install Hemel.DependencyInjection.TypedFactory as a Cake Addin
#addin nuget:?package=Hemel.DependencyInjection.TypedFactory&version=1.0.0-dev.3&prerelease

// Install Hemel.DependencyInjection.TypedFactory as a Cake Tool
#tool nuget:?package=Hemel.DependencyInjection.TypedFactory&version=1.0.0-dev.3&prerelease

Hemel.DependencyInjection.TypedFactory

This Hemel.DependencyInjection.TypedFactory package adds an extension method AddTypedFactory<> to the type Microsoft.Extensions.DependencyInjection.IServiceCollection.

This extension method will implement and register to the service collection a typed factory that is able to instantiate components previously registered to that service collection. The typed factory interface is given to the AddTypedFactory<> method.

Parameters that are not given to the creation methods of the factory interface will be resolved from the service collection, allowing to inject services without having to explictly declare them to the creation method.

Getting started

Here is the NuGet package: Nuget

Install this package into your project then use the extension method AddTypedFactory<> for ServiceCollection.

var services = new ServiceCollection();
services.AddTypedFactory<IFactory>();
// Register other components.

var provider = services.BuildServiceProvider();

var factory = provider.GetRequiredService<IFactory>();

Usage

TODO Examples about how to use your package by providing code snippets/example images, or samples links on GitHub if applicable.

  • Provide sample code using code snippets
  • Include screenshots, diagrams, or other visual help users better understand how to use your package

Additional documentation

Documentation: https://hemelcoding.github.io/DependencyInjection.TypedFactory/

Feedback

If you find any issue with this package, please open an Issue on github: Open an issue

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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
1.0.0-dev.3 92 3/19/2023
1.0.0-dev.2 72 2/24/2023
1.0.0-dev 90 2/17/2023

- Expose an `AddFactory<>()` facility to `IServiceCollection` that auto-implements and registers a typed factory.