Table of Contents

ToCloudEvent Method

Definition

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

ArgumentNullException

message cannot be null.