MemoryCache Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An implementation of IMemoryCache using a dictionary to store its entries.
public ref class MemoryCache : IDisposable, Microsoft::Extensions::Caching::Memory::IMemoryCache
public class MemoryCache : IDisposable, Microsoft.Extensions.Caching.Memory.IMemoryCache
type MemoryCache = class
interface IMemoryCache
interface IDisposable
Public Class MemoryCache
Implements IDisposable, IMemoryCache
- Inheritance
-
MemoryCache
- Implements
Constructors
MemoryCache(IOptions<MemoryCacheOptions>) |
Creates a new MemoryCache instance. |
MemoryCache(IOptions<MemoryCacheOptions>, ILoggerFactory) |
Creates a new MemoryCache instance. |
Properties
Count |
Gets the count of the current entries for diagnostic purposes. |
Methods
Clear() |
Removes all keys and values from the cache. |
Compact(Double) | |
CreateEntry(Object) |
Creates or overwrites an entry in the cache. |
Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
Dispose(Boolean) | |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize() |
Cleans up the background collection events. |
GetCurrentStatistics() |
Gets a snapshot of the current statistics for the memory cache. |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
Remove(Object) |
Removes the object associated with the given key. |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
TryGetValue(Object, Object) |
Gets the item associated with this key if present. |