Поделиться через


InMemoryCache Members

Include Protected Members
Include Inherited Members

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The InMemoryCache type exposes the following members.

Constructors

  Name Description
Public method InMemoryCache(String, Int32, Int32, TimeSpan)
Initializes a new instance of the InMemoryCache class.
Public method InMemoryCache(String, Int32, Int32, IManuallyScheduledWork, IRecurringWorkScheduler)
Initializes a new instance of the InMemoryCache class.

Methods

  Name Description
Public method Add(CacheItem, CacheItemPolicy)
When overridden in a derived class, tries to insert a cache entry into the cache as a CacheItem instance, and adds details about how the entry should be evicted.
(Inherited from ObjectCache.)
Public method Add(String, Object, CacheItemPolicy, String)
When overridden in a derived class, inserts a cache entry into the cache, specifying information about how the entry will be evicted.
(Inherited from ObjectCache.)
Public method Add(String, Object, DateTimeOffset, String)
When overridden in a derived class, inserts a cache entry into the cache without overwriting any existing cache entry.
(Inherited from ObjectCache.)
Public method AddOrGetExisting(CacheItem, CacheItemPolicy)
Inserts the specified CacheItem object into the cache, specifying information about how the entry will be evicted.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method AddOrGetExisting(String, Object, CacheItemPolicy, String)
Inserts a cache entry into the cache, specifying a key and a value for the cache entry, and information about how the entry will be evicted.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method AddOrGetExisting(String, Object, DateTimeOffset, String)
Inserts a cache entry into the cache, by using a key, an object for the cache entry, an absolute expiration value, and an optional region to add the cache into.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Contains
Checks whether the cache entry already exists in the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method CreateCacheEntry
Creates a cache entry.
(Overrides MemoryBackedCacheBase<TCacheEntry>.CreateCacheEntry(String, Object, CacheItemPolicy).)
Public method Dispose()
Releases resources.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method Dispose(Boolean)
Releases resources.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoAddOrGetExisting
Actual implementation for adding or getting a cache item.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoContains
Checks whether the entry identified by a key is stored in memory.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoExpirations
Performs an expiration sweep.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoGet
Actual implementation for getting a cache item.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoGetCount
Gets the total number of cache entries in the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoGetEnumerator
Creates an enumerator that can be used to iterate through a collection of cache entries.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoGetValues
Gets a set of cache entries that correspond to the specified keys.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoRemove
Removes a cache entry from the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoScavenging
Performs a scavenging sweep.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoSet
Inserts a cache entry into the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method DoUpdateLastAccessTime
Updates the last access time on an entry.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected method Finalize
Releases resources.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Get
Gets the specified cache entry from the cache as an object.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method GetCacheItem
Gets the specified cache entry from the cache as a CacheItem instance.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method GetCount
Gets the total number of cache entries in the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method GetEnumerator
Creates an enumerator that can be used to iterate through a collection of cache entries.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method GetValues(IEnumerable<String>, String)
Gets a set of cache entries that correspond to the specified keys.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method GetValues(String, array<String>)
Gets a set of cache entries that correspond to the specified keys.
(Inherited from ObjectCache.)
Protected method InnerAdd
Adds an entry to the dictionary in the cache object.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected method OnItemRemoved
Invoked when an entry was removed from the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method OnItemRemoving
Invoked when an entry is being removed from the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Remove
Removes the cache entry from the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method ScheduleScavenging
Schedules a scavenging operation.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Protected method ScheduleScavengingIfNeeded
Schedules a scavenging operation if needed.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Set(CacheItem, CacheItemPolicy)
Inserts the cache entry into the cache as a CacheItem instance, specifying information about how the entry will be evicted.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Set(String, Object, CacheItemPolicy, String)
Inserts a cache entry into the cache.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method Set(String, Object, DateTimeOffset, String)
Inserts a cache entry into the cache, specifying time-based expiration details.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public method ToString
Returns a String that represents the current Object.
(Inherited from Object.)

Properties

  Name Description
Public property DefaultCacheCapabilities
Gets a description of the features that a cache implementation provides.
(Overrides ObjectCache.DefaultCacheCapabilities.)
Public property Item
Gets or sets the default indexer for the ObjectCache class.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)
Public property Name
Gets the name of the cache instance.
(Inherited from MemoryBackedCacheBase<TCacheEntry>.)

See Also

InMemoryCache Class

Microsoft.Practices.EnterpriseLibrary.Caching Namespace