Click or drag to resize
UserAccessCacheGet Method
Gets a UserAccess cached for a particular key, updating the value if necessary.

Namespace: net.openstack.Core.Caching
Assembly: openstacknet (in openstacknet.dll) Version: 1.7.7+Branch.master.Sha.25d803f397c8693c2c13777ef6675f796f520f2c
Syntax
public UserAccess Get(
	string key,
	Func<UserAccess> refreshCallback,
	bool forceCacheRefresh = false
)

Parameters

key
Type: SystemString
The key.
refreshCallback
Type: SystemFuncUserAccess
A function which returns a new value for the specified key, or if no update function available (see remarks). This function may perform a synchronous authentication to an IIdentityProvider.
forceCacheRefresh (Optional)
Type: SystemBoolean
If , the value associated with key will be always be refreshed by calling refreshCallback, even if a value is already cached.

Return Value

Type: UserAccess
The cached UserAccess associated with the specified key. If no cached value is available (see remarks), the method returns .

Implements

ICacheTGet(String, FuncT, Boolean)
Exceptions
ExceptionCondition
ArgumentNullExceptionIf key is .
Remarks
This method returns a previously cached UserAccess when possible. If any of the following conditions are met, the refreshCallback function will be called to obtain a new value for key which is then added to the cache, replacing any previously cached value.
  • The cache does not contain any value associated with key.
  • forceCacheRefresh is .
  • The previously cached UserAccess for key has expired (see IsExpired).

If any of the above conditions is met and refreshCallback is , the previously cached value for key, if any, is removed from the cache and the method returns .

Version Information

.NET Framework

Supported in: 4.5

openstack.net

Supported in: 1.6, 1.5, 1.4, 1.3.6
See Also