NuGet.Client
NuGet.Client copied to clipboard
Refactoring the method that fetches the project context in the Solution PM UI
Refactoring the method that fetches the project context in the Solution PM UI to return only a single package and simplify the caller logic
Bug
Fixes: https://github.com/NuGet/Home/issues/13216
Description
Addressing feedback from the original pull request for the Transitive Packages in Solution PM UI feature: https://github.com/NuGet/NuGet.Client/pull/6044#discussion_r1774288377. This is a better design to only return one package context object and simplifies the caller logic in determining if the package is top-level or transitive. Removed an outdated comment on the method, and renamed the method to more accurately reflect its purpose.
PR Checklist
- [x] Meaningful title, helpful description and a linked NuGet/Home issue
- [x] ~Added tests~ - Refactoring existing method. No new functionality to test.
- [x] Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.