ContainerEnvironmentCollection Class

A collection of environment variables passed to a container.

public sealed class ContainerEnvironmentCollection : IEnumerable<KeyValuePair<string, string>>, IEnumerable
Implements

Properties

NameDescription
CountGets the number of environment variables in the collection.

Gets the number of environment variables in the collection.

public int Count { get; }

Property value

int

Methods

NameDescription
Add(string, string)Adds or replaces an environment variable.
Contains(string)Determines whether an environment variable is defined.
GetEnumerator()Returns an enumerator over the environment variables.
GetValue(string)Gets the value of an environment variable.
Remove(string)Removes an environment variable.
System.Collections.IEnumerable.GetEnumerator()

Adds or replaces an environment variable.

public void Add(string name, string value)

Parameters

name string
The variable name.
value string
The variable value.

Determines whether an environment variable is defined.

public bool Contains(string name)

Parameters

name string
The variable name.

Returns

bool true if the variable is defined; otherwise, false.

Returns an enumerator over the environment variables.

public IEnumerator<KeyValuePair<string, string>> GetEnumerator()

Gets the value of an environment variable.

public string? GetValue(string name)

Parameters

name string
The variable name.

Returns

string? The value, or null if the variable is not defined.

Removes an environment variable.

public bool Remove(string name)

Parameters

name string
The variable name.

Returns

bool true if the variable was removed; otherwise, false.

System.Collections.IEnumerable.GetEnumerator()

ContainerEnvironmentCollection.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.