Skip to content

Testably/Awaiten

Awaiten

Nuget Build Quality Gate Status Coverage Mutation testing badge

The async-first dependency injection container for .NET.

Awaiten is a Roslyn source generator that wires your object graph at build time. There is no runtime reflection, the configuration is verified by the compiler (missing, cyclic, ambiguous and lifetime-mismatched registrations are build errors), and the generated code is plain, readable C#.

Its headline differentiator is async initialization: services that need asynchronous setup after construction (opening a connection, handshaking with hardware) are tracked through the graph, and touching an uninitialized instance is a compile error.

[Container]
[Singleton<RealTimeSystem, ITimeSystem>]
[Scoped<StorageService, IStorageService>]
[Transient<OrderService, IOrderService>]
public static partial class AppContainer { }

await using var app = new AppContainer.Root();
await app.InitializeAsync();          // async-initialized services are warmed up
var service = app.Get<IOrderService>();

Packages

Package Description
Awaiten Pure core: attributes, the source generator, and the runtime seams. No third-party dependencies.
Awaiten.Extensions.DependencyInjection Microsoft.Extensions.DependencyInjection interop (ASP.NET Core, generic host, and other containers).

Status

Early scaffolding. See the design documents for the full specification, the diagnostic catalogue, and integration recipes (ASP.NET Core, WPF, MS.DI, Autofac).

Building

./build.sh          # or build.cmd / build.ps1 on Windows

The build uses NUKE. Targets include compile, unit tests, API checks, code analysis and packaging.

License

MIT © Valentin Breuß

About

The async-first dependency injection container for .NET.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages