ClientCache.GetClient<T>(Object, Func<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves a client from the cache or creates a new one if it doesn't exist. Updates the last-used timestamp on every hit.
public T GetClient<T>(object clientId, Func<T> createClient) where T : class;
member this.GetClient : obj * Func<'T (requires 'T : null)> -> 'T (requires 'T : null)
Public Function GetClient(Of T As Class) (clientId As Object, createClient As Func(Of T)) As T
Type Parameters
- T
The type of the client.
Parameters
- clientId
- Object
A key representing the client configuration.
- createClient
- Func<T>
A factory function to create the client if not cached.
Returns
The cached or newly created client instance.