Share via


IFormCollection.TryGetValue(String, StringValues) Method

Definition

Gets the value associated with the specified key.

C#
public bool TryGetValue (string key, out Microsoft.Extensions.Primitives.StringValues value);

Parameters

key
String

The key of the value to get.

value
StringValues

The key of the value to get. When this method returns, 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.

Returns

true if the object that implements IFormCollection contains an element with the specified key; otherwise, false.

Exceptions

key is null.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0