public static T Get <T>(this ICacheClient2 client, string key) { T value; client.TryGetAsync(key, out value).Wait(); return(value); }
public static long Decrement(this ICacheClient2 client, string key, uint amount, DateTime expiresAt) { return(client.IncrementAsync(key, -(int)amount, expiresAt.Subtract(DateTime.Now)).Result); }
public static long Decrement(this ICacheClient2 client, string key, uint amount) { return(client.IncrementAsync(key, -(int)amount).Result); }
public static long Increment(this ICacheClient2 client, string key, uint amount, TimeSpan expiresIn) { return(client.IncrementAsync(key, (int)amount, expiresIn).Result); }
public static bool TryGet <T>(this ICacheClient2 client, string key, out T value) { return(client.TryGetAsync(key, out value).Result); }
public static void RemoveAll(this ICacheClient2 client, IEnumerable <string> keys) { client.RemoveAllAsync(keys).Wait(); }
public static bool Remove(this ICacheClient2 client, string key) { return(client.RemoveAllAsync(new[] { key }).Result == 1); }