PostSharp6.1/API Reference/Post­Sharp.​Patterns.​Caching.​Backends Namespace/Memory­Caching­Backend Class

MemoryCachingBackend Class

A CachingBackend based on the system MemoryCache.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Caching.Implementation.CachingBackend
    PostSharp.Patterns.Caching.Backends.MemoryCachingBackend

Namespace:  PostSharp.Patterns.Caching.Backends
Assembly:  PostSharp.Patterns.Caching (in PostSharp.Patterns.Caching.dll) Version: 6.1.23.0 (6.1.23.0)
Syntax
C#
public sealed class MemoryCachingBackend : CachingBackend

The MemoryCachingBackend type exposes the following members.

Constructors
  NameDescription
Public methodMemoryCachingBackend()
Initializes a new MemoryCachingBackend based on the Default instance of the MemoryCache class.
Public methodMemoryCachingBackend(MemoryCache)
Initializes a new MemoryCachingBackend based on a given MemoryCache.
Properties
  NameDescription
Public propertyId
Gets the Guid of the current CachingBackend.
(Inherited from CachingBackend.)
Public propertyStatus
Gets the status of the current CachingBackend (Default, Disposing or Disposed).
(Inherited from CachingBackend.)
Public propertySupportedFeatures
Gets the set of features supported by the current CachingBackend.
(Inherited from CachingBackend.)
Public propertyValueAdapters
Gets the factory of value adapters (IValueAdapter), which allow for instance to cache things like Stream or IEnumerable, which could not be otherwise cached.
(Inherited from CachingBackend.)
Methods
  NameDescription
Public methodClear
Clears the cache.
(Inherited from CachingBackend.)
Public methodClearAsync
Asynchronously clears the cache.
(Inherited from CachingBackend.)
Public methodContainsDependency
Determines whether the cache contains a given dependency.
(Inherited from CachingBackend.)
Public methodContainsDependencyAsync
Asynchronously determines whether the cache contains a given dependency.
(Inherited from CachingBackend.)
Public methodContainsItem
Determines whether the cache contains an item of a given key.
(Inherited from CachingBackend.)
Public methodContainsItemAsync
Asynchronously determines whether the cache contains an item of a given key.
(Inherited from CachingBackend.)
Public methodDispose()
Synchronously disposes the current CachingBackend.
(Inherited from CachingBackend.)
Public methodDisposeAsync
Asynchronously dispose the current CachingBackend.
(Inherited from CachingBackend.)
Public methodGetItem
Gets a cache item given its key.
(Inherited from CachingBackend.)
Public methodGetItemAsync
Asynchronously gets a cache item given its key.
(Inherited from CachingBackend.)
Public methodInvalidateDependency
Removes from the cache all items that have a specific dependency.
(Inherited from CachingBackend.)
Public methodInvalidateDependencyAsync
Asynchronously removes from the cache all items that have a specific dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API.
(Inherited from CachingBackend.)
Public methodRemoveItem
Removes a cache item from the cache given its key.
(Inherited from CachingBackend.)
Public methodRemoveItemAsync
Asynchronously removes a cache item from the cache given its key.
(Inherited from CachingBackend.)
Public methodSetItem
Sets a cache item.
(Inherited from CachingBackend.)
Public methodSetItemAsync
Asynchronously sets a cache item.
(Inherited from CachingBackend.)
Public methodToString
Returns a string that represents the current object.
(Inherited from CachingBackend.)
Public methodWhenBackgroundTasksCompleted
Returns a Task that is signaled to the complete state when all background tasks have completed.
(Inherited from CachingBackend.)
Events
  NameDescription
Public eventDependencyInvalidated
Events raised when a dependency is invalidated. Check the Events property to see if the current CachingBackend supports events.
(Inherited from CachingBackend.)
Public eventItemRemoved
Event raised when a cache item is removed from the cache. Check the Events property to see if the current CachingBackend supports events.
(Inherited from CachingBackend.)
See Also