Table of Contents

Class CacheReadAttribute

Namespace
Apizr.Caching.Attributes
Assembly
Apizr.dll

Tells Apizr to cache Read method You have to provide an ICacheHandler mapping implementation to Apizr to use this feature

[AttributeUsage(AttributeTargets.Class)]
public class CacheReadAttribute : CacheAttributeBase, _Attribute
Inheritance
CacheReadAttribute
Implements
Inherited Members

Constructors

CacheReadAttribute()

Cache with no specific lifetime, default FetchOrGet mode and no invalidation on error

public CacheReadAttribute()

CacheReadAttribute(CacheMode)

Cache with no specific lifetime, no invalidation on error but a specific cache mode

public CacheReadAttribute(CacheMode mode)

Parameters

mode CacheMode

FetchOrGet returns fresh data when request succeed otherwise cached one, where GetOrFetch returns cached data if we get some otherwise fresh one

CacheReadAttribute(CacheMode, bool)

Cache with a specific cache and invalidation on error, but no specific lifetime

public CacheReadAttribute(CacheMode mode, bool shouldInvalidateOnError)

Parameters

mode CacheMode

FetchOrGet returns fresh data when request succeed otherwise cached one, where GetOrFetch returns cached data if we get some otherwise fresh one

shouldInvalidateOnError bool

Should invalidate on error

CacheReadAttribute(CacheMode, string)

Cache with a specific cache and mode specific lifetime, but no invalidation on error

public CacheReadAttribute(CacheMode mode, string lifeSpanRepresentation)

Parameters

mode CacheMode

FetchOrGet returns fresh data when request succeed otherwise cached one, where GetOrFetch returns cached data if we get some otherwise fresh one

lifeSpanRepresentation string

TimeSpan representation to parse

CacheReadAttribute(CacheMode, string, bool)

Cache with a specific cache mode, a specific lifetime and invalidation on error

public CacheReadAttribute(CacheMode mode, string lifeSpanRepresentation, bool shouldInvalidateOnError)

Parameters

mode CacheMode

FetchOrGet returns fresh data when request succeed otherwise cached one, where GetOrFetch returns cached data if we get some otherwise fresh one

lifeSpanRepresentation string

This specific caching lifetime

shouldInvalidateOnError bool

Should invalidate on error

CacheReadAttribute(bool)

Cache with no specific lifetime, default FetchOrGet mode but with or without invalidation on error

public CacheReadAttribute(bool shouldInvalidateOnError)

Parameters

shouldInvalidateOnError bool

Should invalidate on error

CacheReadAttribute(string)

Cache with default FetchOrGet mode, no invalidation on error but with a specific lifetime

public CacheReadAttribute(string lifeSpanRepresentation)

Parameters

lifeSpanRepresentation string

TimeSpan representation to parse

CacheReadAttribute(TimeSpan, bool)

Cache with a specific lifetime and invalidation on error, but default FetchOrGet mode

public CacheReadAttribute(TimeSpan lifeSpan, bool shouldInvalidateOnError)

Parameters

lifeSpan TimeSpan

This specific caching lifetime

shouldInvalidateOnError bool

Should invalidate on error