4 ms·
> C# doesn't allow you to destructure a single property and as far as I can tell https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYAMBYAUBgRj2NwDcBDMAAgAoB9GK8gcw
by metaltyphoon 3y ago
> C# doesn't allow you to destructure a single property and as far as I can tell
https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYAMBYAUBgRj2NwDcBDMAAgAoB9GK8gcwFMBKKgXiqlYHcqABVZgAzgHsoNAEQBbVjJgFM7ANwlUBAJw0WHDbjxhWAYwlg4w0ZOlbMVAHLkFjAJZRgVAIJt1QA= https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYAMBYAUBgRj2Nw...
- Merad 3y agoYour code is destructuring two properties and discarding one of them. It doesn't work with a single property: https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYAMBYAUBgRj2NwDcBDMAAgAoBbAUwEoqBeKqBgdyoAUGwAZwD2UGgCJG4pgG4SqAgE56zObjxgGAY2Fg4fASLELMVAHLlGsoA= https://sharplab.io/#v2:C4LgTgrgdgNAJiA1AHwAICYAMBYAUBgRj2Nw... I think that records don't generate a deconstruct method when they only have one property, but even if you manually define one you'll get an error on `var (varName) = ...`