Table GetOrPut TContext  Method NFX Class Library

[This is preliminary documentation and is subject to change.]

Retrieves an item from this table by key where item age is less or equal to requested, or calls the itemFactory function and inserts the value in the store

Namespace: NFX.DataAccess.Cache
Assembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
Syntax

public CacheRec GetOrPut<TContext>(
	ulong key,
	Func<string, ulong, TContext, Object> valueFactory,
	TContext factoryContext = null,
	int ageSec = 0,
	int putMaxAgeSec = 0,
	int putPriority = 0,
	Nullable<DateTime> putAbsoluteExpirationUTC = null
)

Parameters

key
Type: OnlineSystem UInt64
Item key
valueFactory
Type: OnlineSystem Func OnlineString, OnlineUInt64, TContext, OnlineObject 
A function that returns new value for the specified tableName, key, and context
factoryContext (Optional)
Type: TContext
An object to pass into the factory function if it gets invoked
ageSec (Optional)
Type: OnlineSystem Int32
Age of item in seconds, or 0 for any age
putMaxAgeSec (Optional)
Type: OnlineSystem Int32
MaxAge for item if Put is called
putPriority (Optional)
Type: OnlineSystem Int32
Priority for item if Put is called
putAbsoluteExpirationUTC (Optional)
Type: OnlineSystem Nullable OnlineDateTime 
Absolute expiration UTC timestamp for item if Put is called
Type Parameters

TContext
A type of item factory context

Return Value

Type: CacheRec
See Also