public static Task <IGetResult> GetAndTouch(this ICollection collection, string id, TimeSpan expiration, Action <GetAndTouchOptions> configureOptions) { var options = new GetAndTouchOptions(); configureOptions(options); return(collection.GetAndTouch(id, expiration, options)); }
public Task <IGetResult> GetAndTouch(string id, TimeSpan expiration, IEnumerable <string> projections = null, TimeSpan?timeout = null, DurabilityLevel durabilityLevel = DurabilityLevel.None, CancellationToken token = default(CancellationToken)) { var options = new GetAndTouchOptions { Timeout = timeout, DurabilityLevel = durabilityLevel, Token = token }; return(GetAndTouch(id, expiration, options)); }
public async Task <IGetResult> GetAndTouch(string id, TimeSpan expiration, GetAndTouchOptions options) { var getAndTouchOp = new GetT <byte[]> { Key = id, Cid = Cid, Expires = expiration.ToTtl(), DurabilityLevel = options.DurabilityLevel, DurabilityTimeout = TimeSpan.FromMilliseconds(1500) }; await ExecuteOp(getAndTouchOp, options.Token, options.Timeout); return(new GetResult(getAndTouchOp.Data.ToArray(), _transcoder)); }