Class MessageExtensions
- Assembly
- Savvyio.EventDriven.Messaging.dll
Extension methods for the IMessage<T> interface.
public static class MessageExtensions
- Inheritance
-
ObjectMessageExtensions
Methods
ToCloudEvent<T>(IMessage<T>, String)
Converts the specified message
to an ICloudEvent<T> equivalent.
public static ICloudEvent<T> ToCloudEvent<T>(this IMessage<T> message, string specversion = null)
where T : IIntegrationEvent
Parameters
message
IMessage<T>The payload to attach within the message.
specversion
StringThe version of the CloudEvents specification which the event uses.
Returns
- ICloudEvent<T>
An instance of Message<T> constraint to the IIntegrationEvent interface.
Type Parameters
T
The type of the payload constraint to the IIntegrationEvent interface.
Exceptions
- System.ArgumentNullException
message
cannot be null.