Table of Contents

Class EventEnvelopeCloudEventExtensions

Namespace
Virtufin.Base.Events
Assembly
Virtufin.Base.dll

Extension methods that convert between IEventEnvelope and CloudEvent. Maps envelope fields to standard CloudEvent attributes (id, source, type, subject, time) and Virtufin-specific fields to extension attributes (eventtime, correlationid, lane selectors).

public static class EventEnvelopeCloudEventExtensions
Inheritance
EventEnvelopeCloudEventExtensions
Inherited Members

Methods

ToCloudEvent(IEventEnvelope, object?, string)

Build a CloudEvent from an IEventEnvelope and a payload object (typically the event itself, serialised).

public static CloudEvent ToCloudEvent(this IEventEnvelope envelope, object? payload, string dataContentType = "application/json")

Parameters

envelope IEventEnvelope

Envelope to wrap.

payload object

Event payload (or null for envelope-only).

dataContentType string

Content type for payload; default application/json.

Returns

CloudEvent

ToEnvelope(CloudEvent)

Extract an EventEnvelope from a CloudEvent's extension attributes. The reverse of ToCloudEvent(IEventEnvelope, object?, string).

public static EventEnvelope ToEnvelope(this CloudEvent ce)

Parameters

ce CloudEvent

CloudEvent to extract from.

Returns

EventEnvelope