Add Connection to Nuget
Options
How do I make a connection to Nuget so I can run LINQ queries on packages. I have the latest Linqpad 5 (Premium Edition). I have tried an OData 4 connection but just get errors.
Comments
-
The easiest way is to add a NuGet package reference to NuGet.Core and run a query like this:
var repo = PackageRepositoryFactory.Default.CreateRepository("https://nuget.org/api/v2"); IQueryable<IPackage> packages = repo.GetPackages(); // or: IQueryable<IPackage> packages = repo.Search ("<search terms>", true);
-
Yes, this way is really easier! Thanks for it