Class ThreadSafeCache<TKey, TValue>
Inheritance
System.Object
ThreadSafeCache<TKey, TValue>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Terrasoft.Common.dll
Syntax
public class ThreadSafeCache<TKey, TValue>
where TValue : class
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Constructors
ThreadSafeCache()
Declaration
ThreadSafeCache(Func<TValue, TKey>)
Declaration
public ThreadSafeCache(Func<TValue, TKey> repairFunc)
Parameters
Type |
Name |
Description |
System.Func<TValue, TKey> |
repairFunc |
|
ThreadSafeCache(Int32)
Declaration
public ThreadSafeCache(int capacity)
Parameters
Type |
Name |
Description |
System.Int32 |
capacity |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Values
Declaration
public IEnumerable<TValue> Values { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<TValue> |
|
Methods
Add(TKey, TValue)
Declaration
public void Add(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Clear()
Declaration
Find(TKey)
Declaration
public TValue Find(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Remove(TKey)
Declaration
public bool Remove(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Type |
Description |
System.Boolean |
|
Extension Methods