Show / Hide Table of Contents

Class MemoryCacheStore

The memory cache.

Inheritance
System.Object
MemoryCacheStore
Implements
ICacheStore
IBaseStore
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()
Namespace: Terrasoft.Core.Store
Assembly: Terrasoft.Core.dll
Syntax
public class MemoryCacheStore : ICacheStore, IBaseStore
Remarks

Data is cached in local memory.

Constructors

MemoryCacheStore()

Creates a new instance of the MemoryCacheStore.

Declaration
public MemoryCacheStore()

MemoryCacheStore(String, TimeSpan)

Creates a new instance of the MemoryCacheStore.

Declaration
public MemoryCacheStore(string name, TimeSpan slidingExpiration)
Parameters
Type Name Description
System.String name

Cache name.

System.TimeSpan slidingExpiration

Values expiration time.

Properties

IsLocalCache

Indicates that items are stored in local memory.

Declaration
public bool IsLocalCache { get; }
Property Value
Type Description
System.Boolean

Item[String]

Gets or sets the value by its key.

Declaration
public object this[string key] { get; set; }
Parameters
Type Name Description
System.String key

The key.

Property Value
Type Description
System.Object

The value.

Methods

GetValues(IEnumerable<String>)

Gets values by list of keys.

Declaration
public IDictionary<string, object> GetValues(IEnumerable<string> keys)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> keys

The set of keys for which want to get the values from the cache.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

The dictionary containing the list of keys and the values corresponding to these keys. When the value for a specific key was not found, then an entry with this key will be added to the dictionary with the null value.

Initialize(IDictionary<String, String>)

Initializes the cache with the specified configuration parameters.

Declaration
public void Initialize(IDictionary<string, string> parameters)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.String> parameters

List of the configuration parameters.

Remove(String)

Removes the value from the cache by its key.

Declaration
public void Remove(string key)
Parameters
Type Name Description
System.String key

The key.

Implements

ICacheStore
IBaseStore

Extension Methods

ReflectionUtilities.GetPropertyValue(Object, String)
ReflectionUtilities.GetPropertyDefValue(Object, String, Object)
ReflectionUtilities.TryGetPropertyValue(Object, String, out Object)
ReflectionUtilities.HasProperty(Object, String)
ReflectionUtilities.GetPropertyValue(Object, String, BindingFlags)
ReflectionUtilities.GetPropertyValueByPath(Object, String)
ReflectionUtilities.SetPropertyValue(Object, String, Object)
ReflectionUtilities.TrySetPropertyValue(Object, String, Object)
ValidateUtilities.CheckArgumentNull(Object, String)
ValidateUtilities.CheckDependencyNull(Object, String)
ValidateUtilities.EnsureDependencyNotNull<T>(T, String)
CacheStoreUtilities.WithLocalCaching(ICacheStore, String)
CacheStoreUtilities.WithLocalCaching(ICacheStore)
CacheStoreUtilities.WithLocalCachingOnly(ICacheStore, String, Boolean)
CacheStoreUtilities.ExpireGroup(ICacheStore, String)
CacheStoreUtilities.SetOrRemoveValue(ICacheStore, String, Object)
CacheStoreUtilities.GetValue<T>(IBaseStore, String)
CacheStoreUtilities.GetValue<T>(IBaseStore, String, T)
CacheStoreUtilities.GetValues(ICacheStore, String[])
CacheStoreUtilities.GetRootStore(ICacheStore)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance, Boolean)
NSubstituteExtension.Protected(Object, String, Object[])
NSubstituteExtension.Protected(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedProperty(Object, String)
NSubstituteExtension.MatchInstance<T>(T)
SubstituteUtilities.GetIsSubstituteObject(Object)
SubstituteUtilities.Instead<TInstance, TValue>(TInstance, Func<TInstance, TValue>)
Back to top Generated by DocFX