コード例 #1
0
ファイル: MemoryCache.cs プロジェクト: dimarobert/portal-teme
        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);
        }
コード例 #2
0
ファイル: MemoryCache.cs プロジェクト: dimarobert/portal-teme
 public async Task SetAsync(string key, byte[] value, ExtendedDistributedCacheEntryOptions options, CancellationToken token = default)
 {
     await SetAsync(key, value, options as DistributedCacheEntryOptions, token);
 }
コード例 #3
0
ファイル: MemoryCache.cs プロジェクト: dimarobert/portal-teme
        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);
        }
コード例 #4
0
ファイル: MemoryCache.cs プロジェクト: dimarobert/portal-teme
 public void Set(string key, byte[] value, ExtendedDistributedCacheEntryOptions options)
 {
     Set(key, value, options as DistributedCacheEntryOptions);
 }