Skip to content
bitzorcas
中EN

Concept

Dependency Injection & Lifecycles: Compile-Time Composition

Master Dependency Injection in BitzOrcas.Modern: phased composition order, service lifecycle rules (Scoped / Singleton / Transient), and Native AOT static registration.

Last updated

Under .NET 10 Native AOT, runtime reflection scanning (e.g. services.Scan(...)) is forbidden. BitzOrcas.Modern relies on compile-time static registration + IAppModule phased composition to ensure complete resolution ahead of time.

DI Phased Composition Flow

"4. Minimal API Route Mappings""3. 10-Stage Pipeline Behaviors""2. Domain Modules (IAppModule Composition)""1. Infrastructure Core (DB / Redis / CAP)""API Host (Program.cs)""4. Minimal API Route Mappings""3. 10-Stage Pipeline Behaviors""2. Domain Modules (IAppModule Composition)""1. Infrastructure Core (DB / Redis / CAP)""API Host (Program.cs)"1. AddBitzInfrastructure(...) Register Dual ORM & Cache12. AddBitzModules(...) Invoke IAppModule.ConfigureServices23. AddApplicationPipelines(...) Register strict pipeline order34. MapGeneratedEndpoints(...) Map static endpoints4

Summary

BitzOrcas.Modern eliminates runtime reflection scanning, ensuring compile-time safety and instant AOT cold starts.

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%