Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

fix #1683 by preferring listed packages #2156

Merged
merged 1 commit into from
Jul 1, 2015

Conversation

analogrelay
Copy link
Contributor

...but accepting unlisted packages if there are no matches

Fixes #1683

/cc @davidfowl @ChengTian

@@ -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");
Copy link
Contributor

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?

Copy link
Contributor

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().

Copy link
Contributor

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" ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@troydai
Copy link
Contributor

troydai commented Jun 30, 2015

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");
Copy link
Contributor

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

Copy link
Contributor Author

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

@troydai
Copy link
Contributor

troydai commented Jul 1, 2015

:shipit:

...but accepting unlisted packages if there are no matches
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants