ConfigurationProvider.TryGet(String, String) Method

Definition

Attempts to find a value with the given key.

C#
public virtual bool TryGet(string key, out string? value);

Parameters

key
String

The key to lookup.

value
String

When this method returns, contains the value if one is found.

Returns

true if key has a value; otherwise false.

Implements

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)