Skip to content

Add deconstruct for KeyValuePair#11

Merged
lindexi merged 4 commits into
mainfrom
t/lvyi/key-value-pair
Sep 15, 2025
Merged

Add deconstruct for KeyValuePair#11
lindexi merged 4 commits into
mainfrom
t/lvyi/key-value-pair

Conversation

@walterlv

Copy link
Copy Markdown
Member

No description provided.

@walterlv
walterlv requested a review from Copilot September 12, 2025 11:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds deconstruction support for KeyValuePair<TKey, TValue> to enable tuple-like destructuring syntax. This allows developers to use var (key, value) = kvp; syntax with KeyValuePair objects.

Key changes:

  • Adds a Deconstruct extension method for KeyValuePair<TKey, TValue>
  • Includes conditional compilation to only provide this for frameworks that don't already have it
  • Uses a notnull constraint on the TKey type parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/DotNetCampus.LatestCSharpFeatures/KeyValuePair/KeyValuePair.g.cs Outdated
Comment thread src/DotNetCampus.LatestCSharpFeatures/KeyValuePair/KeyValuePair.g.cs Outdated
@walterlv
walterlv requested a review from Copilot September 12, 2025 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lindexi
lindexi merged commit fea3732 into main Sep 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants