Compze.DependencyInjection
0.3.0-alpha
See the version list below for details.
dotnet add package Compze.DependencyInjection --version 0.3.0-alpha
NuGet\Install-Package Compze.DependencyInjection -Version 0.3.0-alpha
<PackageReference Include="Compze.DependencyInjection" Version="0.3.0-alpha" />
<PackageVersion Include="Compze.DependencyInjection" Version="0.3.0-alpha" />
<PackageReference Include="Compze.DependencyInjection" />
paket add Compze.DependencyInjection --version 0.3.0-alpha
#r "nuget: Compze.DependencyInjection, 0.3.0-alpha"
#:package Compze.DependencyInjection@0.3.0-alpha
#addin nuget:?package=Compze.DependencyInjection&version=0.3.0-alpha&prerelease
#tool nuget:?package=Compze.DependencyInjection&version=0.3.0-alpha&prerelease
Compze.DependencyInjection
Pluggable dependency injection abstractions for Compze.
What is Compze?
Compze is a .NET framework for building expressive domains through Teventive programming and Typermedia APIs. Learn more
What's in this package?
A container-agnostic dependency injection abstraction with a fluent registration API, lifestyle validation, scoped service resolution, and transactional scope execution.
Registration API
// Singleton with dependency injection
Singleton.For<IUserRepository>()
.CreatedBy<IDbConnectionFactory>(factory => new UserRepository(factory));
// Scoped with multiple dependencies
Scoped.For<IOrderService>()
.CreatedBy<IUserRepository, IEventBus>((repo, bus) => new OrderService(repo, bus));
// Pre-created singleton instance
Singleton.For<IConfiguration>()
.Instance(myConfig);
Core abstractions
IDependencyInjectionContainer— Container lifecycle, registration, andIServiceLocatoraccessIServiceLocator— Resolve services by type, create scoped locatorsIComponentRegistrar— Register components with lifestyle and factory methodsLifestyle—SingletonorScoped
Safety features
- Lifestyle validation — Prevents singletons from depending on scoped components
- Duplicate detection — Catches double-registered service types
- Container cloning — Create isolated container copies for testing
Transactional scope execution
serviceLocator.ExecuteInIsolatedScope(locator =>
{
var repo = locator.Resolve<IUserRepository>();
repo.Save(user);
}); // Scope disposed, transaction committed
Installation
dotnet add package Compze.DependencyInjection
Related packages
| Package | Description |
|---|---|
| Compze.DependencyInjection.Microsoft | Microsoft DI integration |
| Compze.DependencyInjection.SimpleInjector | SimpleInjector integration |
| Compze.Utilities | Core utilities |
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Compze.Contracts (>= 0.7.0)
- Compze.Internals.Logging (>= 0.2.0-alpha)
- Compze.Internals.SystemCE (>= 0.2.1-internal)
- Compze.Threading (>= 0.5.0-alpha)
- Compze.Underscore (>= 0.6.0-beta)
- Compze.Unit (>= 0.6.0-beta)
NuGet packages (19)
Showing the top 5 NuGet packages that depend on Compze.DependencyInjection:
| Package | Downloads |
|---|---|
|
Compze.Abstractions
Core abstractions for the Compze framework: entity IDs, message type contracts, time sources, serialization interfaces, and type mapping infrastructure. |
|
|
Compze.Tessaging
Messaging infrastructure for the Compze framework including command, query, and event handling. |
|
|
Compze.Sql.Common
For Compze internal use only. Do not take a direct dependency on this package |
|
|
Compze.Teventive
The Teventive programming model for the Compze framework: taggregates, tevents and tevent dispatching. |
|
|
Compze.Tessaging.Hosting.Testing
Testing support for Compze Tessaging hosting: the Tessaging testing feature for the testing endpoint host, and the Tessaging transport and persistence test wiring. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0-alpha | 261 | 7/24/2026 |
| 0.7.0-alpha | 218 | 7/15/2026 |
| 0.6.0-alpha | 99 | 7/12/2026 |
| 0.5.0-alpha | 81 | 7/11/2026 |
| 0.4.2-alpha | 83 | 7/11/2026 |
| 0.4.1-alpha | 70 | 7/10/2026 |
| 0.4.0-alpha | 119 | 7/10/2026 |
| 0.3.0-alpha | 544 | 6/4/2026 |