コード例 #1
0
        public async Task RemoveAsync(string key)
        {
            if (PreRemove != null)
            {
                PreRemove(this, new CacheEventArgs(key));
            }
            await targetCache.RemoveAsync(key);

            if (PostRemove != null)
            {
                PostRemove(this, new CacheEventArgs(key));
            }
        }
コード例 #2
0
 public override void RemoveItem(HttpContext context, string id, object lockId, SessionStateStoreData item)
 {
     cache.RemoveAsync(id);
 }
コード例 #3
0
 /// <summary>
 ///   Removes the item with specified key from default partition.
 /// </summary>
 /// <param name="cache">The async cache.</param>
 /// <param name="key">The key.</param>
 /// <param name="cancellationToken">An optional cancellation token.</param>
 /// <exception cref="ArgumentNullException"><paramref name="key"/> is null.</exception>
 public static Task RemoveAsync(this IAsyncCache cache, string key, CancellationToken cancellationToken = default(CancellationToken))
 => cache.RemoveAsync(cache.Settings.DefaultPartition, key, cancellationToken);