Skip to content

Commit 787b929

Browse files
authored
Support for record types
1 parent cb2d763 commit 787b929

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nservicebus/messaging/messages-events-commands.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ There are checks in place to ensure best practices are followed. Violations of t
4949

5050
Messages should:
5151

52-
* Be simple [POCO](https://en.wikipedia.org/wiki/Plain_old_CLR_object) types
52+
* Be simple [POCO](https://en.wikipedia.org/wiki/Plain_old_CLR_object) types and can be of type `class`, `struct`, or `record`.
5353
* Be as small as possible
5454
* Satisfy the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle)
5555
* Favor simplicity and redundancy over object-oriented practices like inheritance
5656
* Not be re-used for other purposes (e.g., domain objects, data access objects, or UI binding objects)
5757

5858
> [!NOTE]
59-
> Prior to NServiceBus version 7.2, messages had to be defined as a `class`. Defining them as a `struct` would result in a runtime exception.
59+
> - `struct` is supported since 7.2+.
60+
> - `record` is supported since 9.0+.
6061
6162
Generic message definitions (e.g., `MyMessage<T>`) are not supported. It is recommended to use dedicated, simple types for each message.
6263

0 commit comments

Comments
 (0)