# EnvironmentVariableSnapshot

- Kind: `record`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CustomResourceSnapshot.cs)
- Implements: `IEquatable<EnvironmentVariableSnapshot>`

A snapshot of an environment variable.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed record EnvironmentVariableSnapshot
    : System.IEquatable<Aspire.Hosting.ApplicationModel.EnvironmentVariableSnapshot>
{
    // ...
}
```

## Constructors

- [EnvironmentVariableSnapshot(string, string?, bool)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/constructors.md#constructor-string-string-bool) -- A snapshot of an environment variable.

## Properties

- [IsFromSpec](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/properties.md#isfromspec) : `bool` `get; init` -- Determines if this environment variable was defined in the resource explicitly or computed (for e.g. inherited from the process hierarchy).
- [Name](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/properties.md#name) : `string` `get; init` -- The name of the environment variable.
- [Value](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/properties.md#value) : `string?` `get; init` -- The value of the environment variable.

## Methods

- [<Clone>$](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#clone) : [EnvironmentVariableSnapshot](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot.md)
- [Deconstruct(string, string?, bool)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#deconstruct-string-string-bool)
- [Equals(object?)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#equals-object) : `bool` -- Determines whether the specified object is equal to the current object.
- [Equals(EnvironmentVariableSnapshot?)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#equals-environmentvariablesnapshot) : `bool` -- Indicates whether the current object is equal to another object of the same type.
- [GetHashCode](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#gethashcode) : `int` -- Serves as the default hash function.
- [op_Equality(EnvironmentVariableSnapshot?, EnvironmentVariableSnapshot?)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#op-equality-environmentvariablesnapshot-environmentvariablesnapshot) : `bool` `static`
- [op_Inequality(EnvironmentVariableSnapshot?, EnvironmentVariableSnapshot?)](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#op-inequality-environmentvariablesnapshot-environmentvariablesnapshot) : `bool` `static`
- [ToString](/reference/api/csharp/aspire.hosting/environmentvariablesnapshot/methods.md#tostring) : `string` -- Returns a string that represents the current object.
