Class SagaChoreographyPublication
Namespace: Cephalon.Behaviors.Patterns.Abstractions
Assembly: Cephalon.Behaviors.Patterns.dll
Describes one event publication produced by a choreography-based saga step.
public sealed class SagaChoreographyPublicationInheritance
Section titled “Inheritance”object ← SagaChoreographyPublication
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
Section titled “Constructors”SagaChoreographyPublication(string, string, string, string, DateTimeOffset, string?, string?, string?, bool, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)
Section titled “ SagaChoreographyPublication(string, string, string, string, DateTimeOffset, string?, string?, string?, bool, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?)”Initializes a new instance of
public SagaChoreographyPublication(string id, string channelId, string eventType, string payload, DateTimeOffset occurredAtUtc, string? contentType = null, string? correlationId = null, string? tenantId = null, bool isCompensation = false, IReadOnlyDictionary<string, string>? headers = null, IReadOnlyDictionary<string, string>? metadata = null)Parameters
Section titled “Parameters”id string
The stable publication identifier.
channelId string
The logical channel or destination identifier.
eventType string
The logical event type identifier.
payload string
The serialized event payload.
occurredAtUtc DateTimeOffset
The time at which the publication occurred.
contentType string?
The payload content type when one is known.
correlationId string?
The correlation identifier associated with the publication.
tenantId string?
The tenant identifier associated with the publication.
isCompensation bool
Indicates whether the publication represents compensation work.
headers IReadOnlyDictionary<string, string>?
Optional event headers.
metadata IReadOnlyDictionary<string, string>?
Optional event metadata.
Properties
Section titled “Properties”ChannelId
Section titled “ ChannelId”Gets the logical channel or destination identifier.
public string ChannelId { get; }Property Value
Section titled “Property Value”ContentType
Section titled “ ContentType”Gets the payload content type when one is known.
public string? ContentType { get; }Property Value
Section titled “Property Value”CorrelationId
Section titled “ CorrelationId”Gets the correlation identifier associated with the publication.
public string? CorrelationId { get; }Property Value
Section titled “Property Value”EventType
Section titled “ EventType”Gets the logical event type identifier.
public string EventType { get; }Property Value
Section titled “Property Value”Headers
Section titled “ Headers”Gets the event headers associated with the publication.
public IReadOnlyDictionary<string, string> Headers { get; }Property Value
Section titled “Property Value”IReadOnlyDictionary<string, string>
Gets the stable publication identifier.
public string Id { get; }Property Value
Section titled “Property Value”IsCompensation
Section titled “ IsCompensation”Gets a value indicating whether this publication represents compensation work.
public bool IsCompensation { get; }Property Value
Section titled “Property Value”Metadata
Section titled “ Metadata”Gets the event metadata associated with the publication.
public IReadOnlyDictionary<string, string> Metadata { get; }Property Value
Section titled “Property Value”IReadOnlyDictionary<string, string>
OccurredAtUtc
Section titled “ OccurredAtUtc”Gets the time at which the publication occurred.
public DateTimeOffset OccurredAtUtc { get; }Property Value
Section titled “Property Value”Payload
Section titled “ Payload”Gets the serialized event payload.
public string Payload { get; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”Gets the tenant identifier associated with the publication.
public string? TenantId { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CreateCompensationJson<TPayload>(string, string, string, TPayload, DateTimeOffset, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, JsonSerializerOptions?)
Section titled “ CreateCompensationJson<TPayload>(string, string, string, TPayload, DateTimeOffset, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, JsonSerializerOptions?)”Creates one choreography publication with a JSON-serialized payload that is explicitly marked as compensation work.
public static SagaChoreographyPublication CreateCompensationJson<TPayload>(string id, string channelId, string eventType, TPayload payload, DateTimeOffset occurredAtUtc, string? correlationId = null, string? tenantId = null, IReadOnlyDictionary<string, string>? headers = null, IReadOnlyDictionary<string, string>? metadata = null, JsonSerializerOptions? serializerOptions = null)Parameters
Section titled “Parameters”id string
The stable publication identifier.
channelId string
The logical channel or destination identifier.
eventType string
The logical event type identifier.
payload TPayload
The typed payload to serialize as JSON.
occurredAtUtc DateTimeOffset
The time at which the publication occurred.
correlationId string?
The correlation identifier associated with the publication.
tenantId string?
The tenant identifier associated with the publication.
headers IReadOnlyDictionary<string, string>?
Optional event headers.
metadata IReadOnlyDictionary<string, string>?
Optional event metadata.
serializerOptions JsonSerializerOptions?
Optional JSON serializer options for the payload.
Returns
Section titled “Returns”The choreography publication with a JSON payload, compensation flag, and JSON content type.
Type Parameters
Section titled “Type Parameters”TPayload
The payload type to serialize.
CreateJson<TPayload>(string, string, string, TPayload, DateTimeOffset, string?, string?, bool, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, JsonSerializerOptions?)
Section titled “ CreateJson<TPayload>(string, string, string, TPayload, DateTimeOffset, string?, string?, bool, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, JsonSerializerOptions?)”Creates one choreography publication with a JSON-serialized payload.
public static SagaChoreographyPublication CreateJson<TPayload>(string id, string channelId, string eventType, TPayload payload, DateTimeOffset occurredAtUtc, string? correlationId = null, string? tenantId = null, bool isCompensation = false, IReadOnlyDictionary<string, string>? headers = null, IReadOnlyDictionary<string, string>? metadata = null, JsonSerializerOptions? serializerOptions = null)Parameters
Section titled “Parameters”id string
The stable publication identifier.
channelId string
The logical channel or destination identifier.
eventType string
The logical event type identifier.
payload TPayload
The typed payload to serialize as JSON.
occurredAtUtc DateTimeOffset
The time at which the publication occurred.
correlationId string?
The correlation identifier associated with the publication.
tenantId string?
The tenant identifier associated with the publication.
isCompensation bool
Indicates whether the publication represents compensation work.
headers IReadOnlyDictionary<string, string>?
Optional event headers.
metadata IReadOnlyDictionary<string, string>?
Optional event metadata.
serializerOptions JsonSerializerOptions?
Optional JSON serializer options for the payload.
Returns
Section titled “Returns”The choreography publication with a JSON payload and application/json content type.
Type Parameters
Section titled “Type Parameters”TPayload
The payload type to serialize.