Created
May 6, 2015 17:28
-
-
Save jeffrymorris/417dbe9ff0f1b001c464 to your computer and use it in GitHub Desktop.
async/await example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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