Skip to content

Instantly share code, notes, and snippets.

@jeffrymorris
Created May 6, 2015 17:28
Show Gist options
  • Save jeffrymorris/417dbe9ff0f1b001c464 to your computer and use it in GitHub Desktop.
Save jeffrymorris/417dbe9ff0f1b001c464 to your computer and use it in GitHub Desktop.
async/await example
public async void UpsertAndGet()
{
using (var cluster = new Cluster())
{
using (var bucket = cluster.OpenBucket())
{
var upsert = await bucket.UpsertAsync("mykey", new
{
Foo = "foo",
Bar = 10
});
if (upsert.Success)
{
var get = await bucket.GetAsync<dynamic>("mykey");
if (get.Success)
{
Console.WriteLine(get.Value);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment