예제 #1
0
        public static async Task <string> GetString(this IKeyValueCache cache, string key)
        {
            var bytes = await cache.GetBytes(key);

            var str = Encoding.UTF8.GetString(bytes);

            return(str);
        }
예제 #2
0
        public static async Task <byte[]> TryGetBytes(this IKeyValueCache cache, string key)
        {
            try
            {
                var bytes = await cache.GetBytes(key);

                return(bytes);
            }
            catch
            {
                return(null);
            }
        }