Unexpected result.
For example the second getting throws exception. I think such behavior is wrong.
var mutResult1 = await collection.InsertAsync(id1, (int)5, insertOptions => insertOptions
.Expiry(TimeSpan.FromMilliseconds(10000)));
var getResult1 = await collection.GetAsync(id1);
var value1 = getResult1.ContentAs<int>();
Console.WriteLine(value1);
Console.WriteLine("--------------------------------------------");
var getResult2 = await collection.GetAsync(id1, getOptions => getOptions.Expiry());
var value2 = getResult2.ContentAs<int>();
Console.WriteLine(value2);
5
--------------------------------------------
System.ArgumentException
System.ArgumentException: Can not convert Object to Int32.
at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject[T]()
at Couchbase.KeyValue.GetResult.ContentAs[T]()
at ConsoleApp1.CouchbaseTesting.Test() in C:\Users\Ivant\source\repos\ConsoleApp1\ConsoleApp1\CouchbaseTesting.cs:line 42
Both doesn’t work as expected with expiry. And both work as expected without expiry. I want to get exactly the same I put to database. Not exception or with addition technical data.