TaskHub.Shared.Refactoring
Reflection-based tools for automated dependency discovery and assembly scanning.
Contents
Summary
- Automates DI registration for Repositories and Services.
- Provides
ServiceInfo metadata for telemetry.
- Opinionated and minimal design.
TaskHub.Shared.Refactoring is an internal infrastructure module that provides a lightweight reflection-based approach for resolving and registering dependencies, as well as collecting basic service metadata.
Core Idea
The module solves a narrow set of problems:
- Reduce repetitive dependency registration code.
- Centralize interface-to-implementation resolution.
- Provide a single, consistent
ServiceInfo source.
- Enable controlled assembly scanning with explicit opt-out.
Assembly Scanning
The module scans application assemblies once per application lifetime at startup. System and vendor assemblies are excluded by default to:
- Reduce startup cost.
- Avoid accidental bindings.
- Improve determinism.
Dependency Resolution
- **AddAppDependency**: Registers the single implementation found for interface T.
- **AddAppDependencies**: Registers all implementations found for interface T.