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); }
public async Task SetAsync(string key, byte[] value, ExtendedDistributedCacheEntryOptions options, CancellationToken token = default) { await SetAsync(key, value, options as DistributedCacheEntryOptions, token); }
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); }
public void Set(string key, byte[] value, ExtendedDistributedCacheEntryOptions options) { Set(key, value, options as DistributedCacheEntryOptions); }