Commit e2706cd
committed
[C#] Add validation to DTOs and improve use of records.
The aim of these changes are to avoid multiple representations in DTOs
and to support read-only views over data.
The new validation includes:
- Checking null values "idiomatic null values" rather than the reserved
null value, to prevent against multiple kinds of null in DTOs.
- Checking primitive field values are at least `minValue` and at most
`maxValue`. Note that this validation is not applied to fixed-size
arrays as the specification says, "Data range attributes minValue and
maxValue do not apply", under the "Fixed-length data" section.
Records are now immutable. Record expressions, i.e., using `with`, are
supported and will apply validation, as we have customised the `init`
property accessor.
I have not included support for encoding null composite values from
DTOs; however, in theory, this could be added later.1 parent 6f2a5d6 commit e2706cd
File tree
2 files changed
+278
-76
lines changed- sbe-tool/src
- main/java/uk/co/real_logic/sbe/generation/csharp
- propertyTest/java/uk/co/real_logic/sbe/properties/arbitraries
2 files changed
+278
-76
lines changed
0 commit comments