-
Notifications
You must be signed in to change notification settings - Fork 224
fix #1683 by preferring listed packages #2156
Conversation
@@ -24,6 +24,10 @@ public class NuGetv2Feed : IPackageFeed | |||
private static readonly XName _xnameProperties = XName.Get("properties", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); | |||
private static readonly XName _xnameId = XName.Get("Id", "http://schemas.microsoft.com/ado/2007/08/dataservices"); | |||
private static readonly XName _xnameVersion = XName.Get("Version", "http://schemas.microsoft.com/ado/2007/08/dataservices"); | |||
private static readonly XName _xnamePublish = XName.Get("Published", "http://schemas.microsoft.com/ado/2007/08/dataservices"); |
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.
Extract the string of namespace to a constant 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.
Even better - you can just use +
instead of XName.Get()
.
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.
create:
XNamespace astoriaNs = "http://schemas.microsoft.com/ado/2007/08/dataservices");
use inline:
... astoriaNs + "Published" ...
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.
👍
⌚ |
63e09c2
to
407c4e5
Compare
private static readonly XName _xnameProperties = XName.Get("properties", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); | ||
private static readonly XName _xnameId = XName.Get("Id", "http://schemas.microsoft.com/ado/2007/08/dataservices"); | ||
private static readonly XName _xnameVersion = XName.Get("Version", "http://schemas.microsoft.com/ado/2007/08/dataservices"); | ||
private static readonly XNamespace _odataMetadataNamespace = XNamespace.Get("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); |
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.
nit: you don't need XNamespace.Get
- just
private static readonly XNamespace _odataMetadataNamespace = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
it will know to convert the string to XNamespace
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.
I suppose... though I dislike implicit conversion operators :). I'll do it though, because you asked nicely :P
407c4e5
to
8222546
Compare
...but accepting unlisted packages if there are no matches
8222546
to
8fd7e41
Compare
...but accepting unlisted packages if there are no matches
Fixes #1683
/cc @davidfowl @ChengTian