-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor fixes to the GET DeleteSymbols endpoint #6937
Conversation
(Tests will be fixed after I pull in #6912.) |
f916241
to
87056b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Select(p => p.LatestSymbolPackage()) | ||
.Where(sp => sp != null && sp.StatusKey == PackageStatus.Available) | ||
.Select(sp => new PackageViewModel(sp.Package)); | ||
.Where(p => (p.LatestSymbolPackage()?.StatusKey ?? PackageStatus.Deleted) == PackageStatus.Available); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of ?? PackageStatus.Deleted
? null
by itself is not equal to any enum value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum
s are int
s internally, which means they don't support null
.
Therefore, I must convert the null
to a valid enum
value before I can compare.
A couple fixes that were done while working on #6912 but moved to here because they are separate to it
Two issues fixed here:
DeleteSymbols
requires all versions of the package but doesn't callFindPackagesById
DeleteSymbols
usesSelectList
(which uses reflection and dynamic objects) instead ofIEnumerable<SelectListItem>