I'm trying to read data from an OData V2 service using the Simple.OData.Client library, but I am having zero success after hours of hair-pulling.
using Simple.OData.Client;
using System;
using System.Linq;
using System.Threading.Tasks;
class Program
{
public static void Main(string[] args)
{
Foo();
}
public static async Task Foo()
{
Console.WriteLine("This happened");
var client = new ODataClient("https://www.nuget.org/api/v2/");
var packages = await client.FindEntriesAsync("Packages?$filter=Title eq 'SDK'");
Console.WriteLine("Found packages: " + packages.Count());
foreach (var package in packages)
{
Console.WriteLine(package["Title"]);
}
}
}
Running this code yields only This happened in the console, nothing else is printed and no exceptions are thrown. For some reason even the second print statement doesn't work... but why?
I am completely lost as to why this doesn't work.
This is literally a copy of the code from the Getting Started guide: https://github.com/simple-odata-client/Simple.OData.Client/wiki/Getting-started-with-Simple.OData.Client
Can anyone help me figure this out?