Skip to content

Invariant records #5574

Dec 25, 2021 · 3 comments · 7 replies
Discussion options

You must be logged in to vote

Support for validation is missing in records because the language team decided that such policy should not be built into the language, but provided through external means like source generators. This is why all of the members otherwise auto-generated by records can also be provided through explicit code in a partial class. I'd suggest that your source generator would remain the correct avenue to implement that logic.

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@SteveDunn
Comment options

@HaloFour
Comment options

@SteveDunn
Comment options

@HaloFour
Comment options

Answer selected by SteveDunn
@mwisnicki
Comment options

@SteveDunn
Comment options

@mwisnicki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants