fl-event-handling-extensions
0.1.1
dotnet add package fl-event-handling-extensions --version 0.1.1
NuGet\Install-Package fl-event-handling-extensions -Version 0.1.1
<PackageReference Include="fl-event-handling-extensions" Version="0.1.1" />
<PackageVersion Include="fl-event-handling-extensions" Version="0.1.1" />
<PackageReference Include="fl-event-handling-extensions" />
paket add fl-event-handling-extensions --version 0.1.1
#r "nuget: fl-event-handling-extensions, 0.1.1"
#:package fl-event-handling-extensions@0.1.1
#addin nuget:?package=fl-event-handling-extensions&version=0.1.1
#tool nuget:?package=fl-event-handling-extensions&version=0.1.1
Fl.Event.Handling.Extensions
This library provides dependency injection extensions for registering the event handling components from Fl.Event.Handling into an IServiceCollection.
Components
EventHandlingStrategy
An enum that controls how an event is dispatched to its registered handlers.
| Value | Description |
|---|---|
Sequential |
Handlers are invoked one at a time, in registration order. Processing stops immediately if any handler returns an error. |
Parallel |
Handlers are invoked concurrently and all are awaited before the result is returned. |
ServiceCollectionExtensions
Provides the AddEventHandling<TEvent> extension method on IServiceCollection.
IServiceCollection AddEventHandling<TEvent>(
this IServiceCollection services,
EventHandlingStrategy strategy,
Assembly assembly)
where TEvent : class
This method:
- Registers an
IEventProcessor<TEvent>singleton — eitherSequentialEventProcessor<TEvent>orParallelEventProcessor<TEvent>— depending on the chosenstrategy. - Scans the provided
assemblyand registers all concreteIEventHandler<TEvent>implementations as singleton services.
An ArgumentException is thrown if strategy is not a valid EventHandlingStrategy value.
Usage
using Fl.Event.Handling.Extensions;
using System.Reflection;
// Inside your IServiceCollection configuration (e.g. Program.cs or a startup class):
services.AddEventHandling<MyEvent>(
EventHandlingStrategy.Sequential,
Assembly.GetExecutingAssembly());
To use the parallel strategy instead:
services.AddEventHandling<MyEvent>(
EventHandlingStrategy.Parallel,
Assembly.GetExecutingAssembly());
Multiple event types can be registered independently:
services.AddEventHandling<OrderPlacedEvent>(EventHandlingStrategy.Sequential, Assembly.GetExecutingAssembly());
services.AddEventHandling<PaymentReceivedEvent>(EventHandlingStrategy.Parallel, Assembly.GetExecutingAssembly());
Each call scans the assembly for the corresponding IEventHandler<TEvent> implementations and registers them alongside their processor.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- fl-event-handling (>= 0.1.1)
-
net8.0
- fl-event-handling (>= 0.1.1)
-
net9.0
- fl-event-handling (>= 0.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1 | 304 | 5/4/2026 |