Table of Contents

Clone Method

Definition

Namespace
Savvyio.Messaging
Assemblies
Savvyio.Messaging.dll
Source
src/Savvyio.Messaging/MessageExtensions.cs

Clone<T>(IMessage<T>, Func<IMessage<T>>)

Clones the specified message using either the specified copier or the default implementation that return a new instance of Message<T>.

public static IMessage<T> Clone<T>(this IMessage<T> message, Func<IMessage<T>> copier = null) where T : IRequest

Parameters

message IMessage<T>

The IMessage<T> to clone.

copier Func<IMessage<T>>

The function delegate that is used to clone the specified message. Default is null.

Returns

IMessage<T>

An implementation of IMessage<T> that is an otherwise clone of the specified message.

Type Parameters

T

The type of the payload constraint to the IRequest interface.

Exceptions

ArgumentNullException

message cannot be null.