> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# EnvironmentLoader

> Loads and parses http-client.env.json environment files.

## Definition

**Assembly:** CloudNimble.Breakdance.DotHttp.dll

**Namespace:** CloudNimble.Breakdance.DotHttp

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.Breakdance.DotHttp.EnvironmentLoader
```

## Summary

Loads and parses http-client.env.json environment files.

## Remarks

Supports \$shared variables, environment-specific values, provider-based secrets, and .user file overrides.

## Examples

```csharp theme={"dark"}
var loader = new EnvironmentLoader();
var environment = loader.LoadFromFile("http-client.env.json");
var variables = loader.GetResolvedVariables(environment, "dev");
```

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public EnvironmentLoader()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetResolvedVariables

Gets the resolved variables for a specific environment, including \$shared values.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.Dictionary<string, string> GetResolvedVariables(CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment environment, string environmentName)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `environment` | `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` | The environment configuration. |
| `environmentName` | `string` | The name of the environment (e.g., "dev", "staging"). |

#### Returns

Type: `System.Collections.Generic.Dictionary<string, string>`
A dictionary of resolved variable names and values.

#### Examples

```csharp theme={"dark"}
var loader = new EnvironmentLoader();
var env = loader.LoadFromFile("http-client.env.json");
var devVars = loader.GetResolvedVariables(env, "dev");
// devVars contains merged $shared and dev-specific variables
```

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;LoadFromFile

Loads an environment configuration from a JSON file path.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment LoadFromFile(string filePath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `filePath` | `string` | The path to the http-client.env.json file. |

#### Returns

Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment`
A [DotHttpEnvironment](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment.md) containing the parsed configuration.

#### Examples

```csharp theme={"dark"}
var loader = new EnvironmentLoader();
var environment = loader.LoadFromFile("http-client.env.json");
foreach (var envName in environment.Environments.Keys)
{
    Console.WriteLine($"Environment: {envName}");
}
```

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;MergeWithUserOverrides

Merges the user override file (.user) with the base environment.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment MergeWithUserOverrides(CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment baseEnvironment, string userFilePath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `baseEnvironment` | `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment` | The base environment from http-client.env.json. |
| `userFilePath` | `string` | The path to the http-client.env.json.user file. |

#### Returns

Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment`
The merged environment configuration.

#### Examples

```csharp theme={"dark"}
var loader = new EnvironmentLoader();
var baseEnv = loader.LoadFromFile("http-client.env.json");
var mergedEnv = loader.MergeWithUserOverrides(baseEnv, "http-client.env.json.user");
```

#### Remarks

User override values take precedence over base environment values.

### &#x20;Parse

Parses environment configuration from JSON content.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment Parse(string jsonContent)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `jsonContent` | `string` | The JSON content of the environment file. |

#### Returns

Type: `CloudNimble.Breakdance.DotHttp.Models.DotHttpEnvironment`
A [DotHttpEnvironment](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/Models/DotHttpEnvironment.md) containing the parsed configuration.

#### Examples

```csharp theme={"dark"}
var loader = new EnvironmentLoader();
var json = @"{
  ""$shared"": { ""ApiVersion"": ""v2"" },
  ""dev"": { ""HostAddress"": ""https://localhost:5001"" }
}";
var environment = loader.Parse(json);
```

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.