Skip to content

Commit

Permalink
feat: add clearing all cache items
Browse files Browse the repository at this point in the history
  • Loading branch information
aochmann committed May 21, 2021
1 parent 6e352ff commit 4c5ab93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;

namespace Cogworks.Essentials.Services.Interfaces
Expand All @@ -17,5 +17,7 @@ Task<T> GetOrAddCacheItemAsync<T>(string cacheKey, Func<Task<T>> getValueFunctio
void RemoveCacheItem(string cacheKey);

bool Contains(string cacheKey);

void ClearAll();
}
}
4 changes: 2 additions & 2 deletions Source/Cogworks.Essentials/Services/MemoryCacheService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -123,7 +123,7 @@ public void DeleteAllStartingWith(string cacheKey)
RemoveCacheKeyList(cacheKeysToRemove);
}

public void DeleteAll()
public void ClearAll()
{
var cacheKeys = GetOrAddCacheKeyList();

Expand Down

0 comments on commit 4c5ab93

Please sign in to comment.