I am trying to connect to Couchbase using JSON configuration in an ASP.NET Core console application. The documentation looks like this:
var jsonConfiguration = builder.Build();
var clientConfig = new ClientConfiguration(jsonConfiguration.Get(name));
However, I can’t figure out where the Get extension method lives. I get a compile time error that says IConfigurationManager doesn’t contain a method called Get. Maybe I’m missing something completely obvious, but I can’t find it for the life of me.
However, I think the syntax may have changed slightly since the prerelease version of the package. Try this (substitute the string for the path to the config in your JSON file):
var definition = new CouchbaseClientDefinition();
jsonConfiguration.GetSection("couchbase:couchbaseClient").Bind(definition);