canpolat@programming.dev to Programming@programming.devEnglish · 2 年前Typing is not a programming bottleneckblog.ploeh.dkexternal-linkmessage-square41fedilinkarrow-up1108arrow-down118
arrow-up190arrow-down1external-linkTyping is not a programming bottleneckblog.ploeh.dkcanpolat@programming.dev to Programming@programming.devEnglish · 2 年前message-square41fedilink
minus-squareCatPoop@lemmy.worldlinkfedilinkEnglisharrow-up12·2 年前Assuming this is C#, you could just make Reservation a record type, which can be defined with a one line primary constructor, is immutable and has value type equality. Second example is an insane amount of boilerplate.
minus-squarecopygirl@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up3·2 年前And you can use the with expression to create clones of the object with some properties modified.
Assuming this is C#, you could just make Reservation a record type, which can be defined with a one line primary constructor, is immutable and has value type equality. Second example is an insane amount of boilerplate.
And you can use the
with
expression to create clones of the object with some properties modified.