Registry T  GetOrRegister Method NFX Class Library

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

Overload List

  NameDescription
Public methodGetOrRegister TContext (String, Func TContext, T , TContext)
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
Public methodGetOrRegister TContext (String, Func TContext, T , TContext, Boolean )
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
Back to Top
See Also