Exemplo n.º 1
0
        public static void SetString(this IExtendedDistributedCache cache, string key, string value, ExtendedDistributedCacheEntryOptions options)
        {
            if (key is null)
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (value is null)
            {
                throw new ArgumentNullException(nameof(value));
            }
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            cache.Set(key, Encoding.UTF8.GetBytes(value), options);
        }
Exemplo n.º 2
0
 public async Task SetAsync(string key, byte[] value, ExtendedDistributedCacheEntryOptions options, CancellationToken token = default)
 {
     await SetAsync(key, value, options as DistributedCacheEntryOptions, token);
 }
Exemplo n.º 3
0
        public static async Task SetStringAsync(this IExtendedDistributedCache cache, string key, string value, ExtendedDistributedCacheEntryOptions options, CancellationToken token = default)
        {
            if (key is null)
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (value is null)
            {
                throw new ArgumentNullException(nameof(value));
            }
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            await cache.SetAsync(key, Encoding.UTF8.GetBytes(value), options, token);
        }
Exemplo n.º 4
0
 public void Set(string key, byte[] value, ExtendedDistributedCacheEntryOptions options)
 {
     Set(key, value, options as DistributedCacheEntryOptions);
 }