Class DefaultResultCachePolicy
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
policyFunc<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
messageIDispatchMessageThe dispatch message.
resultobjectThe action result.
Returns
- bool
trueto cache the result.