TaskHub.Shared

TaskHub.Shared.Refactoring

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. This module is intentionally opinionated, minimal, and non-universal.

Core Idea

The module solves a narrow set of problems:

Assembly Scanning

The module scans application assemblies to discover user-defined interfaces and their concrete implementations. System and vendor assemblies are excluded by default to:

Dependency Resolution

The module supports two explicit dependency resolution modes. The chosen mode is defined by the bootstrap call site, not by the module itself.

Single Implementation Resolution

services.AddAppDependency<T>();

This call scans assemblies for interface T and its single implementation, registering the pair in the DI container. Use this method when:

Multiple Implementations Resolution

services.AddAppDependencies<T>();

Resolves and registers all matching implementations, registering them in the DI container. Use this method when multiple implementations are expected and valid.

ServiceInfo

A centralized service information provider. Contains metadata from the entry assembly and the current runtime environment. Options:

Registration

The constructed ServiceInfo instance is registered as a singleton in IServiceCollection.

services.AddServiceInfo();