Table of Contents

Method TryGetValue

Namespace
MongoDB.Bson.IO
Assembly
MongoDB.Bson.dll

TryGetValue(ArraySegment<byte>, out TValue)

Gets the value associated with the specified element name.

public bool TryGetValue(ArraySegment<byte> utf8, out TValue value)

Parameters

utf8 ArraySegment<byte>

The element name.

value TValue

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

Returns

bool

True if the value was found; otherwise, false.

TryGetValue(string, out TValue)

Gets the value associated with the specified element name.

public bool TryGetValue(string elementName, out TValue value)

Parameters

elementName string

The element name.

value TValue

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

Returns

bool

True if the value was found; otherwise, false.