Skip to content

anonymous /App.config
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="localcouchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
</configSections>
<localcouchbase>
<servers bucket="default">
<add uri="http://localhost:8091/pools" />
</servers>
</localcouchbase>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CouchbaseNetClient" version="1.2.0" targetFramework="net40" />
<package id="Hammock" version="1.2.9" targetFramework="net40" />
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
</packages>
using System;
using System.Configuration;
using Couchbase;
using Couchbase.Configuration;
namespace CouchbaseIncrementWithCASTest
{
class Program
{
static void Main(string[] args)
{
var couchbaseClient = new CouchbaseClient((ICouchbaseClientConfiguration)ConfigurationManager.GetSection("localcouchbase"));
var cacheKey = Guid.NewGuid().ToString();
var casResult = couchbaseClient.GetWithCas<ulong>(cacheKey);
var incrementResult = couchbaseClient.Increment(cacheKey, (ulong)DateTime.Now.Ticks, 0, TimeSpan.FromMinutes(1), casResult.Cas);
Console.WriteLine(incrementResult.Result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.