Open sandboxFocus

Class ValueAdapterFactory

Registers and provides value adapters (IValueAdapter), which make it possible, for example, to cache objects such as Stream or IEnumerable, which could not be cached otherwise.

Inheritance
ValueAdapterFactory
Namespace: PostSharp.Patterns.Caching.ValueAdapters
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public sealed class ValueAdapterFactory
Remarks

Each backend has its own instance, exposed by the ValueAdapters property. Adapters for Stream, IEnumerable<T> and IEnumerator<T> are registered by default. To adapt a generic type, register the generic type definitions of the value type and of the adapter type, which must have the same number of generic parameters.

Methods

Name Description
Get(Type)

Gets an IValueAdapter given a value type.

Register(Type, IValueAdapter)

Registers an IValueAdapter instance and explicitly specifies the value type.

Register(Type, Type)

Registers a generic value adapter.

Register<T>(IValueAdapter<T>)

Registers an IValueAdapter<T>.

See Also