Interface IVersionedMessage
Marker interface for messages that support explicit versioning.
public interface IVersionedMessage
- Extension Methods
Remarks
Any message type implementing this interface can be automatically upcasted through the IUpcastingPipeline when older versions are encountered. This includes domain events, commands, queries, and integration events.
Properties
MessageType
Gets the logical message type name (version-independent).
string MessageType { get; }
Property Value
Remarks
This should remain constant across versions. Examples:
- "UserCreatedEvent" for UserCreatedEventV1, V2, V3
- "CreateUserCommand" for CreateUserCommandV1, V2, V3
- "GetUserQuery" for GetUserQueryV1, V2, V3
Version
Gets the schema version of this message.
int Version { get; }
Property Value
Remarks
Version numbers should start at 1 and increment sequentially. Breaking changes require a version increment.