Table of Contents

Class DefaultResultCachePolicy

Namespace
Excalibur.Dispatch.Caching
Assembly
Excalibur.Dispatch.Caching.dll

Default implementation of result cache policy that uses a delegate function to determine caching behavior. Provides flexible caching logic based on message and result content.

public sealed class DefaultResultCachePolicy : IResultCachePolicy
Inheritance
DefaultResultCachePolicy
Implements
Inherited Members
Extension Methods

Constructors

DefaultResultCachePolicy(Func<IDispatchMessage, object?, bool>)

Default implementation of result cache policy that uses a delegate function to determine caching behavior. Provides flexible caching logic based on message and result content.

public DefaultResultCachePolicy(Func<IDispatchMessage, object?, bool> policy)

Parameters

policy Func<IDispatchMessage, object, bool>

The delegate function that determines whether to cache a specific message result.

Methods

ShouldCache(IDispatchMessage, object?)

Returns true when the result should be cached.

public bool ShouldCache(IDispatchMessage message, object? result)

Parameters

message IDispatchMessage

The dispatch message.

result object

The action result.

Returns

bool

true to cache the result.