Skip to content

Small library that implements the dependency injection model.

License

Notifications You must be signed in to change notification settings

TheXDS/ServicePool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServicePool

CodeFactor Build ServicePool Publish ServicePool Issues codecov MIT

ServicePool is a customizable dependency injection library that offers the well-known benefits of DI as seen on ASP.Net projects, but extends on this concept by offering different kinds of service comsumption models (singletons, factories, one-offs) and the ability to have more than one pool with a set of independently resolved services.

The dependency injection model implemented by this library also adds a bit more flexibility when resolving dependencies for a class, even allowing a consumer app to specify its own resolution logic.

Releases

Release Link
Latest public release: Latest stable NuGet package
Latest development release: Latest development NuGet package

Package Manager

Install-Package TheXDS.ServicePool

.NET CLI

dotnet add package TheXDS.ServicePool

Paket CLI

paket add TheXDS.ServicePool

Package reference

<PackageReference Include="TheXDS.ServicePool" Version="2.0.0" />

C# interactive window (CSI)

#r "nuget: TheXDS.ServicePool, 2.0.0"

Building

ServicePool can be built on any platform or CI environment supported by dotnet.

Prerequisites

Build ServicePool

dotnet build ./src/ServicePool.sln

The resulting binaries will be in the ./Build/bin directory.

Testing ServicePool

dotnet test ./src/ServicePool.sln

Coverage reports

It is possible to generate a coverage report locally. For that, it is necessary to install ReportGenerator, which will read the test results after execution, and will generate a web page with the coverage results.

To install ReportGenerator execute:

dotnet tool install -g dotnet-reportgenerator-globaltool

After installing ReportGenerator, it will be possible to execute the following command:

dotnet test ./src/ServicePool.sln --collect:"XPlat Code Coverage" --results-directory:./Build/Tests ; reportgenerator -reports:./Build/Tests/*/coverage.cobertura.xml -targetdir:./Build/Coverage/

The coverage reports will be stored in ./Build/Coverage

Contribute

Buy Me A Coffee

If ServicePool is useful to you, or if you're interested in donating to sponsor the project, feel free to to a donation via PayPal, BuyMeACoffee or just contact me directly.

Sadly, I cannot offer other means of sending donations as of right now due to my country (Honduras) not being supported by almost any platform.