PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​Value­AdaptersValue­Adapter­FactoryRegister
Open sandboxFocus

ValueAdapterFactory.Register Method

Register(Type, IValueAdapter)

Registers an IValueAdapter instance and explicitly specifies the value type.

Declaration
public void Register(Type valueType, IValueAdapter valueAdapter)
Parameters
Type Name Description
System.Type valueType

The type of the cached value (typically the return type of the cached method).

IValueAdapter valueAdapter

The adapter.

Register(Type, Type)

Registers a generic value adapter.

Declaration
public void Register(Type valueType, Type valueAdapterType)
Parameters
Type Name Description
System.Type valueType

The type of the cached value (typically the return type of the cached method).

System.Type valueAdapterType

The type of the value adapter. This type must implement the IValueAdapter interface and have the same number of generic parameters as valueType.

Register<T>(IValueAdapter<T>)

Registers an IValueAdapter<T>.

Declaration
public void Register<T>(IValueAdapter<T> valueAdapter)
Parameters
Type Name Description
IValueAdapter<T> valueAdapter

The adapter.

Type Parameters
Name Description
T

The type of the cached value (typically the return type of the cached method).