Share via


TeamFoundationCacheService<TKey, TValue>.TryGetValue Method

Gets the value associated with the specified key.

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public Function TryGetValue ( _
    requestContext As TeamFoundationRequestContext, _
    key As TKey, _
    <OutAttribute> ByRef value As TValue _
) As Boolean
public bool TryGetValue(
    TeamFoundationRequestContext requestContext,
    TKey key,
    out TValue value
)
public:
bool TryGetValue(
    TeamFoundationRequestContext^ requestContext, 
    TKey key, 
    [OutAttribute] TValue% value
)
member TryGetValue : 
        requestContext:TeamFoundationRequestContext * 
        key:'TKey * 
        value:'TValue byref -> bool
public function TryGetValue(
    requestContext : TeamFoundationRequestContext, 
    key : TKey, 
    value : TValue
) : boolean

Parameters

  • key
    Type: TKey

    The key of the value to obtain.

  • value
    Type: TValue%

    When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter.

Return Value

Type: System.Boolean
true if the cache contains an element that has the specified key; otherwise, false.

Remarks

This method is thread safe.

.NET Framework Security

See Also

Reference

TeamFoundationCacheService<TKey, TValue> Class

Microsoft.TeamFoundation.Framework.Server Namespace