Releases: NetLah/event-aggregator
Releases · NetLah/event-aggregator
.NET 9.0 Preview 2
Support .NET 8.0
- Support .NET 8.0
- New Directory.Build.targets with Common.props, Directory.Build.override.targets and Directory.Build.initial.targets
Support .NET 7.0
- Support .NET 7.0
- Decoupling to NetLah.Abstractions
- Refactoring
- Drop .NET5
- Consolidate Directory.Build.targets
- Revisit safe with null
- More tests
Decoupling to NetLah.Abstractions
- Decoupling to NetLah.Abstractions
- Refactoring
- Drop .NET5
- Consolidate Directory.Build.targets
- Revisit safe with null
- More tests
Support .NET 6.0
- Support .NET 6.0
- Explicit dependencies on multi Target Frameworks netstandard2.1, netstandard2.0
New build for .NET 6.0 RC2 dependencies
- New build for .NET 6.0 RC2 dependencies
- Explicit dependencies on multi Target Frameworks netstandard2.1, netstandard2.0
Explicit dependencies on multi Target Frameworks net6.0, net5.0, netstandard2.1 and netstandard2.0
Explicit dependencies on multi Target Frameworks net6.0, net5.0, netstandard2.1 and netstandard2.0
Pre-release
Pre-release
- Explicit dependencies on multi Target Frameworks net6.0, net5.0, netstandard2.1 and netstandard2.0
- Update package tags
First release v0.1.0
Classes/interfaces:
IEventAggregator
IRootEventAggregator
Getting started
services.AddEventAggregator();
services.AddSingleton<RootEvent1Subscriber>();
services.SubscribeAsync<BaseEvent1, RootEvent1Subscriber>(lifetime: SubscriberLifetime.Singleton);
services.AddScoped<Event1Subscriber>();
services.SubscribeAsync<Event1, Event1Subscriber>();
// IEventAggregator eventAggregator
// both RootEvent1Subscriber and Event1Subscriber subscribe on Event1
await eventAggregator.PublishAsync(new Event1 { Payload = payload1 });
Interface subscriber
public interface IAsyncSubscriber<in TEvent> where TEvent : IEvent
{
Task HandleAsync(TEvent @event, CancellationToken cancellationToken = default);
}
public interface ISubscriber<in TEvent> where TEvent : IEvent
{
void Handle(TEvent @event);
}
Delegate subscriber
public static IServiceCollection SubscribeAsync<TEvent>(this IServiceCollection services,
Func<TEvent, IServiceProvider, CancellationToken, Task> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);
public static IServiceCollection SubscribeAsync<TEvent>(this IServiceCollection services,
Func<TEvent, IServiceProvider, Task> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);
public static IServiceCollection Subscribe<TEvent>(this IServiceCollection services,
Action<TEvent, IServiceProvider> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);
First preview version 0.1.0-preview1
Classes/interfaces:
IEventAggregator
IRootEventAggregator
Getting started
services.AddEventAggregator();
services.AddSingleton<RootEvent1Subscriber>();
services.SubscribeAsync<BaseEvent1, RootEvent1Subscriber>(lifetime: SubscriberLifetime.Singleton);
services.AddScoped<Event1Subscriber>();
services.SubscribeAsync<Event1, Event1Subscriber>();
// IEventAggregator eventAggregator
// both RootEvent1Subscriber and Event1Subscriber subscribe on Event1
await eventAggregator.PublishAsync(new Event1 { Payload = payload1 });
Interface subscriber
public interface IAsyncSubscriber<in TEvent> where TEvent : IEvent
{
Task HandleAsync(TEvent @event, CancellationToken cancellationToken = default);
}
public interface ISubscriber<in TEvent> where TEvent : IEvent
{
void Handle(TEvent @event);
}
Delegate subscriber
public static IServiceCollection SubscribeAsync<TEvent>(this IServiceCollection services,
Func<TEvent, IServiceProvider, CancellationToken, Task> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);
public static IServiceCollection SubscribeAsync<TEvent>(this IServiceCollection services,
Func<TEvent, IServiceProvider, Task> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);
public static IServiceCollection Subscribe<TEvent>(this IServiceCollection services,
Action<TEvent, IServiceProvider> handler,
SubscriberLifetime lifetime = SubscriberLifetime.Scoped);