Partager via


ModelStateDictionary.TryGetValue Method

Attempts to gets the value that is associated with the specified key.

Namespace:  System.Web.Http.ModelBinding
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Function TryGetValue ( _
    key As String, _
    <OutAttribute> ByRef value As ModelState _
) As Boolean
'Usage
Dim instance As ModelStateDictionary
Dim key As String
Dim value As ModelState
Dim returnValue As Boolean

returnValue = instance.TryGetValue(key, _
    value)
public bool TryGetValue(
    string key,
    out ModelState value
)
public:
virtual bool TryGetValue(
    String^ key, 
    [OutAttribute] ModelState^% value
) sealed
abstract TryGetValue : 
        key:string * 
        value:ModelState byref -> bool 
override TryGetValue : 
        key:string * 
        value:ModelState byref -> bool 
public final function TryGetValue(
    key : String, 
    value : ModelState
) : boolean

Parameters

Return Value

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

Implements

IDictionary<TKey, TValue>.TryGetValue(TKey, TValue%)

See Also

Reference

ModelStateDictionary Class

System.Web.Http.ModelBinding Namespace