Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Core Concepts — Requests, ValueTask Handlers & Pipeline Behaviors

EricksonLopez.Mediator enforces compile-time request contracts and struct-constrained pipeline continuations.

  • ICommand<TResponse> / ICommandHandler<in TCommand, TResponse>: Returns ValueTask<TResponse>.
  • IQuery<TResponse> / IQueryHandler<in TQuery, TResponse>: Returns ValueTask<TResponse>.
  • INotification / INotificationHandler<in TNotification>: Returns ValueTask; supports [PublishStrategy(PublishStrategy)] and [NotificationOrder(int)].
  • IStreamRequest<TResponse>: Streaming contract (note: named IStreamRequest<T>, not IStreamQuery<T>), dispatched via ISender.CreateStream<TResponse>(...).
ValueTask<TResponse> Handle<TNext>(
TRequest request,
TNext next,
CancellationToken cancellationToken)
where TNext : struct, INext<TResponse>;

Invoke the downstream pipeline via await next.InvokeAsync() (zero-argument ValueTask<TResponse>), not next(). Attach behaviors declaratively with [UseBehavior(typeof(...), order: 0)] or [UseGlobalBehavior(...)].

StaticMediator allows explicit handler registration (RegisterCommandHandler, RegisterQueryHandler, RegisterNotificationHandler), Freeze(), IsFrozen, Reset(), and direct SendCommand / SendQuery / Publish calls without a ServiceProvider.