Skip to content

Repository files navigation

Awaiten

NugetBuildQuality Gate StatusCoverage

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 generated code is plain readable C#, and your container is native-AOT clean. The configuration is verified by the compiler: missing, cyclic, ambiguous, and lifetime-mismatched registrations are build errors.

Its headline feature is async initialization. Services that need asynchronous setup after construction, like opening a connection or handshaking with hardware, are tracked through the graph. Reaching one before it is ready is a compile error.

Quick start

usingAwaiten;[Container][Singleton<EspressoMachine>][Scoped<Order>][Transient<Cup>]publicstaticpartialclassCoffeeShop;awaitusing var shop =newCoffeeShop.Root();awaitshop.InitializeAsync();// async-initialized services are warmed upvarcup=shop.Resolve<Cup>();

Install with:

dotnet add package Awaiten

Features

  • Async initialization.IAsyncInitializable services are initialized in dependency order, and reaching one synchronously is a compile error.
  • Compile-time safety. Around 90 diagnostics turn wiring mistakes into build errors instead of startup crashes.
  • No reflection. The generated code is plain C#, so the container is native-AOT clean and trim-safe.
  • A full toolbox. Lifetimes, scopes, keyed services, decorators, composites, open generics, collections, factories, modules, assembly scanning, property injection, and Owned<T> for disposable transients.
  • MS.DI interop. A separate package bridges into Microsoft.Extensions.DependencyInjection for ASP.NET Core and the generic host.

Packages

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

Documentation

Full documentation lives at docs.testably.org/Awaiten.

About

The async-first dependency injection container for .NET.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Contributors

Languages