コード例 #1
0
 /// <summary>
 /// Asynchronously sends the specified message.
 /// </summary>
 /// <param name="source">The <see cref="ISender"/> from which to send the message.</param>
 /// <param name="message">The message to send.</param>
 public static Task SendAsync(this ISender source, SenderMessage message)
 {
     if (source is null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     return(source.SendAsync(message, default));
 }
コード例 #2
0
 /// <summary>
 /// Synchronously sends the specified message.
 /// </summary>
 /// <param name="source">The <see cref="ISender"/> from which to send the message.</param>
 /// <param name="message">The message to send.</param>
 public static void Send(this ISender source, SenderMessage message) =>
 source.SendSync(s => s.SendAsync(message));
コード例 #3
0
 /// <summary>
 /// Asynchronously sends the specified message.
 /// </summary>
 /// <param name="source">The <see cref="ISender"/> from which to send the message.</param>
 /// <param name="message">The message to send.</param>
 public static Task SendAsync(this ISender source, SenderMessage message) =>
 source.SendAsync(message, default(CancellationToken));
コード例 #4
0
 /// <summary>
 /// Validates, then adds the specified message to the transaction.
 /// </summary>
 /// <param name="message">The message to add.</param>
 public void Add(SenderMessage message)
 {
     Validate(message);
     Transaction.Add(message);
 }
コード例 #5
0
 /// <summary>
 /// Validates, then asynchronously sends the specified message.
 /// </summary>
 /// <param name="message">The message to send.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 public Task SendAsync(SenderMessage message, CancellationToken cancellationToken)
 {
     Validate(message);
     return(Sender.SendAsync(message, cancellationToken));
 }