Udostępnij za pośrednictwem


DataCollection<TKey, TValue>.TryGetValue Method (TKey, TValue)

 

Applies To: Dynamics CRM 2015

Gets the value associated with the specified key.

Namespace:   Microsoft.Xrm.Sdk
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)

Syntax

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

Parameters

  • key
    Type: TKey

    Type: TKey. The key of the value to get.

  • value
    Type: TValue

    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. This parameter is passed uninitialized.

Return Value

Type: System.Boolean

Type: Boolean
true if the DataCollection<TKey, TValue> contains an element with the specified key; otherwise, false.

See Also

DataCollection<TKey, TValue> Class
Microsoft.Xrm.Sdk Namespace

Return to top

© 2016 Microsoft. All rights reserved. Copyright