Files
Hyperbar/Hyperbar/Lifecycles/ICache.cs
T
2024-01-14 20:35:38 +00:00

30 lines
507 B
C#

using Microsoft.Extensions.DependencyInjection;
namespace Hyperbar;
public interface ICache<TValue> :
IEnumerable<TValue>
{
void Add(TValue value);
void Clear();
bool Remove(TValue value);
}
public interface ICache<TKey, TValue> :
IEnumerable<KeyValuePair<TKey, TValue>>
where TKey : notnull
{
void Add(TKey key,
TValue value);
void Clear();
bool ContainsKey(TKey key);
bool Remove(TKey key);
bool TryGetValue(TKey key, out TValue? value);
}