Skip to content

Releases: NetLah/event-aggregator

.NET 9.0 Preview 2

21 Mar 08:19
1b13e48
Compare
Choose a tag to compare
1.0.0-rc2

Publish to CloudSmith

Support .NET 8.0

13 Jan 09:18
a13aaf9
Compare
Choose a tag to compare
  • Support .NET 8.0
  • New Directory.Build.targets with Common.props, Directory.Build.override.targets and Directory.Build.initial.targets

Support .NET 7.0

07 Jan 15:20
02ef03f
Compare
Choose a tag to compare
  • 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

14 Sep 06:41
Compare
Choose a tag to compare
Pre-release
  • Decoupling to NetLah.Abstractions
  • Refactoring
  • Drop .NET5
  • Consolidate Directory.Build.targets
  • Revisit safe with null
  • More tests

Support .NET 6.0

15 Nov 10:51
Compare
Choose a tag to compare
  • Support .NET 6.0
  • Explicit dependencies on multi Target Frameworks netstandard2.1, netstandard2.0

New build for .NET 6.0 RC2 dependencies

18 Oct 08:15
Compare
Choose a tag to compare
Pre-release
  • 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

30 Sep 02:28
Compare
Choose a tag to compare
  • Explicit dependencies on multi Target Frameworks net6.0, net5.0, netstandard2.1 and netstandard2.0
  • Update package tags

First release v0.1.0

19 May 08:36
Compare
Choose a tag to compare

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

17 May 04:16
Compare
Choose a tag to compare
Pre-release

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);