Title: Reduce dependency footprint by making Scrutor optional and offering manual handler registration
Labels: enhancement, mediator
Body:
Problem
The core Cortex.Mediator package depends on Scrutor 6.0.1 for assembly scanning. This:
- Adds a transitive dependency that consumers may not want
- Prevents use in environments where assembly scanning is undesirable (e.g., Blazor WASM, NativeAOT)
- Is the only non-Microsoft dependency in the core package
Proposed Solution
Option A (minimal): Add a manual registration API alongside assembly scanning:
services.AddCortexMediator(options =>
{
options.AddCommandHandler<CreateUserCommand, Guid, CreateUserCommandHandler>();
options.AddQueryHandler<GetUserQuery, UserDto, GetUserQueryHandler>();
options.AddNotificationHandler<UserCreatedNotification, SendEmailHandler>();
// Pipeline behaviors as today
});
Option B (structural): Move Scrutor-based scanning to a separate Cortex.Mediator.Scrutor package:
- Core
Cortex.Mediator has zero non-Microsoft dependencies
Cortex.Mediator.Scrutor provides services.AddCortexMediator(markerTypes, ...) with assembly scanning
Both options can coexist and are not mutually exclusive.
Title: Reduce dependency footprint by making Scrutor optional and offering manual handler registration
Labels:
enhancement,mediatorBody:
Problem
The core
Cortex.Mediatorpackage depends onScrutor 6.0.1for assembly scanning. This:Proposed Solution
Option A (minimal): Add a manual registration API alongside assembly scanning:
Option B (structural): Move Scrutor-based scanning to a separate
Cortex.Mediator.Scrutorpackage:Cortex.Mediatorhas zero non-Microsoft dependenciesCortex.Mediator.Scrutorprovidesservices.AddCortexMediator(markerTypes, ...)with assembly scanningBoth options can coexist and are not mutually exclusive.