There were some issues when compiling a sample code from documentation. I had to add the following using statements in order for VS to recognize ClientConfiguration, PasswordAuthenticator and List objects. I ran the code with .Net SDK 2.7.12
class Program
{
static void Main(string[] args)
{
var cluster = new Cluster(new ClientConfiguration
{
Servers = new List<Uri> { new Uri("http://localhost") }
});
var authenticator = new PasswordAuthenticator("Administrator", "password");
cluster.Authenticate(authenticator);
using (var bucket = cluster.OpenBucket("userprofile"))
{
var document = new Document<dynamic>
{
Id = "Hello",
Content = new
{
name = "Couchbase"
}
};
var upsert = bucket.Upsert(document);
if (upsert.Success)
{
var get = bucket.GetDocument<dynamic>(document.Id);
document = get.Document;
var msg = string.Format("{0} {1}!", document.Id, document.Content.name);
Console.WriteLine(msg);
}
Console.Read();
}
}
}