Error when creating ContentfulClient

I came back to a project from a few months ago to finish it up and when I updated the Contentful nuget package, I had several errors pop up. Almost all of them were regarding GetEntriesAsync(), saying it doesn’t exist. I used GetEntries() instead and all those errors went away. I’m assuming that is ok, but to be honest, I’m not sure. The error I still have though is for this code here:

 public static ContentfulClient GetClient()
    {
        return new ContentfulClient(new HttpClient(), "inserttoken", "inserttoken");
    }

The error says “There is no argument given that corresponds to the required formal parameter ‘spaceId’ of ‘ContentfulClient.ContentfulClient(HttpClient, string, string, string, bool);” Any idea what’s going on here?

Hi there,

I confirmed this with a colleague of mine and there were a couple of changes between version 1.x and our 2.0 release.

All of the Async prefixes of the method names were dropped, e.g. GetEntriesAsync became GetEntries. Other than that, the method signature stayed the same. The methods are still asynchronous and you should still use the await keyword when you call them.

Hope this helps :slight_smile: