Skip to content

Commit

Permalink
feat: add new Send method in Messenger
Browse files Browse the repository at this point in the history
  • Loading branch information
sandre58 committed Jun 15, 2024
1 parent 5ff8617 commit d8805da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MyNet.Utilities/Messaging/IMessenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public interface IMessenger
/// <param name="message">The message to send to registered recipients.</param>
void Send<TMessage>(TMessage message);

void Send<TMessage>();

/// <summary>
/// Sends a message to registered recipients. The message will
/// reach only recipients that registered for this message type
Expand Down
2 changes: 2 additions & 0 deletions src/MyNet.Utilities/Messaging/Messenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ public static IMessenger Default
/// <param name="message">The message to send to registered recipients.</param>
public virtual void Send<TMessage>(TMessage message) => SendToTargetOrType(message, null, null);

public virtual void Send<TMessage>() => SendToTargetOrType(Activator.CreateInstance<TMessage>(), null, null);

/// <summary>
/// Sends a message to registered recipients. The message will
/// reach only recipients that registered for this message type
Expand Down

0 comments on commit d8805da

Please sign in to comment.