Table of Contents

Class MessageExtensions

Namespace
Savvyio.EventDriven.Messaging.CloudEvents
Assembly
Savvyio.EventDriven.Messaging.dll

Extension methods for the IMessage<T> interface.

public static class MessageExtensions
Inheritance
Object
MessageExtensions

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 String

The 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.