Even more weird... while looking for alternative ways to do this, I realized that the Version property actually works, but again, not as you would expect...
The following throws an InvalidOperationException:
GetPackages().Where(p => p.Version.SpecialVersion == null);
However, the error message was particularly interesting: "No property 'SpecialVersion' exists in type 'Edm.String' at position 8."
This made me think "is it possible that the Queryable implementation actually considers version to be a String rather than a SemanticVersion object?".
Which led me to the following query:
GetPackages().Where(p => (((object)p.Version)) == (object)"5.0");
All the casts are to make sure that VisualStudio even allows me to compile the code... but surprisingly, it works!! This gave me the list of all the packages having exactly version string 5.0...
Unfortunately, I can't do much with this, since all other interesting methods like Contains seem to throw exceptions as well...
Did anyone notice this at all? I would expect this to be a big deal if you're looking for non-prerelease packages and so on. How does VisualStudio even deal with this in the first place?
The following throws an InvalidOperationException:
GetPackages().Where(p => p.Version.SpecialVersion == null);
However, the error message was particularly interesting: "No property 'SpecialVersion' exists in type 'Edm.String' at position 8."
This made me think "is it possible that the Queryable implementation actually considers version to be a String rather than a SemanticVersion object?".
Which led me to the following query:
GetPackages().Where(p => (((object)p.Version)) == (object)"5.0");
All the casts are to make sure that VisualStudio even allows me to compile the code... but surprisingly, it works!! This gave me the list of all the packages having exactly version string 5.0...
Unfortunately, I can't do much with this, since all other interesting methods like Contains seem to throw exceptions as well...
Did anyone notice this at all? I would expect this to be a big deal if you're looking for non-prerelease packages and so on. How does VisualStudio even deal with this in the first place?