Class MessageExtensions
- Namespace
- Savvyio.EventDriven.Messaging.CloudEvents
- 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
messageIMessage<T>The payload to attach within the message.
specversionstringThe version of the CloudEvents specification which the event uses.
Returns
- ICloudEvent<T>
An instance of Message<T> constraint to the IIntegrationEvent interface.
Type Parameters
TThe type of the payload constraint to the IIntegrationEvent interface.
Exceptions
- ArgumentNullException
messagecannot be null.