Registry T  GetOrRegister TContext  Method (String, Func TContext, T , TContext)NFX Class Library

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

Tries to find an item by name, and returns it if it is found, otherwise calls a factory function supplying context value and registers the obtained new item. The first lookup is performed in a lock-free way and if an item is found then it is immediately returned. The second check and factory call operation is performed atomically under the lock to ensure consistency

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

public T GetOrRegister<TContext>(
	string name,
	Func<TContext, T> regFactory,
	TContext context
)

Parameters

name
Type: OnlineSystem String
regFactory
Type: OnlineSystem Func TContext, T 
context
Type: TContext
Type Parameters

TContext

Return Value

Type: T
See Also