Add ToDictionary extensions on IDictionary#41
Merged
Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/1fae76cb-448e-4220-a83e-af9cc4b1b09f Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 17, 2026 06:57
View session
Tyrrrz
reviewed
Apr 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #41 +/- ##
==========================================
+ Coverage 94.47% 94.61% +0.14%
==========================================
Files 76 80 +4
Lines 1574 1615 +41
Branches 131 134 +3
==========================================
+ Hits 1487 1528 +41
Misses 65 65
Partials 22 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/3c3b48e0-603c-41b3-8245-6705e3af60e8 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot
AI
changed the title
Add
Add Apr 17, 2026
ToDictionary extension on IDictionaryToDictionary extensions on IDictionary
Tyrrrz
reviewed
Apr 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new ToDictionary<TKey, TValue>(IEqualityComparer<TKey>) extension for non-generic IDictionary, enabling conversion into a typed Dictionary<TKey, TValue> while allowing the caller to control key comparison semantics.
Changes:
- Added an
extension(IDictionary)block withToDictionary<TKey, TValue>(IEqualityComparer<TKey>)inCollectionExtensions. - Added a new xUnit test covering
IDictionary→Dictionary<TKey, TValue>conversion behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| PowerKit/Extensions/CollectionExtensions.cs | Introduces IDictionary.ToDictionary<TKey, TValue>(comparer) conversion implemented via DictionaryEntry + LINQ ToDictionary. |
| PowerKit.Tests/CollectionExtensionsTests.cs | Adds test coverage for the new ToDictionary extension. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/7b2e1cff-8093-4d46-84c6-ee49c7deaa4d Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
reviewed
Apr 17, 2026
Tyrrrz
reviewed
Apr 17, 2026
…nalIgnoreCase in custom comparer test Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/3911b564-c5f7-4c05-8e2a-a968a65f9d65 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/69fab7ac-8a8c-4e1b-9689-0711bcf9f19f Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
reviewed
Apr 17, 2026
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/c06bda06-133c-4119-b6b7-f8d2604d59b7 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
reviewed
Apr 17, 2026
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/ca2d3f49-5e5c-4a52-94b2-e8e34ed06f78 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
approved these changes
Apr 17, 2026
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports
ToDictionaryextensions from CliFx, enabling typed conversion of a non-genericIDictionarytoDictionary<TKey, TValue>.Changes
DictionaryExtensions.cs: New file with anextension(IDictionary)block containing two overloads:ToDictionary<TKey, TValue>(IEqualityComparer<TKey> comparer)— casts eachDictionaryEntryto the typed key/value pair and delegates toEnumerable.ToDictionarywith the given comparer.ToDictionary<TKey, TValue>()— usesEqualityComparer<TKey>.Defaultas the comparer.DictionaryExtensionsTests.cs: Covers result type, comparer identity, and key/value contents for both overloads.Usage