# ResourceStateSnapshot Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ResourceStateSnapshot](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md)
- Kind: `Methods`
- Members: `9`

A snapshot of the resource state

## <Clone>$

- Name: `<Clone>$`
- Returns: [ResourceStateSnapshot](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md)

```csharp
public record ResourceStateSnapshot
{
    public ResourceStateSnapshot <Clone>$()
    {
        // ...
    }
}
```

## Deconstruct(string, string?)

- Name: `Deconstruct(string, string?)`

```csharp
public record ResourceStateSnapshot
{
    public void Deconstruct(
        out string Text,
        out string? Style)
    {
        // ...
    }
}
```

## Parameters

- `Text` (`string`)
- `Style` (`string?`)

## Equals(object?)

- Name: `Equals(object?)`
- Modifiers: `override`
- Returns: `bool`

Determines whether the specified object is equal to the current object.

```csharp
public record ResourceStateSnapshot
{
    public override bool Equals(
        object? obj)
    {
        // ...
    }
}
```

## Parameters

- `obj` (`object?`)
  The object to compare with the current object.

## Returns

`bool` -- `true` if the specified object is equal to the current object; otherwise, `false`.

## Equals(ResourceStateSnapshot?)

- Name: `Equals(ResourceStateSnapshot?)`
- Returns: `bool`

Indicates whether the current object is equal to another object of the same type.

```csharp
public record ResourceStateSnapshot
{
    public bool Equals(
        ResourceStateSnapshot? other)
    {
        // ...
    }
}
```

## Parameters

- `other` ([ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md))
  An object to compare with this object.

## Returns

`bool` -- `true` if the current object is equal to the `other` parameter; otherwise, `false`.

## GetHashCode

- Name: `GetHashCode`
- Modifiers: `override`
- Returns: `int`

Serves as the default hash function.

```csharp
public record ResourceStateSnapshot
{
    public override int GetHashCode()
    {
        // ...
    }
}
```

## Returns

`int` -- A hash code for the current object.

## op_Equality(ResourceStateSnapshot?, ResourceStateSnapshot?)

- Name: `op_Equality(ResourceStateSnapshot?, ResourceStateSnapshot?)`
- Modifiers: `static`
- Returns: `bool`

```csharp
public record ResourceStateSnapshot
{
    public static bool operator ==(
        ResourceStateSnapshot? left,
        ResourceStateSnapshot? right)
    {
        // ...
    }
}
```

## Parameters

- `left` ([ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md))
- `right` ([ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md))

## op_Implicit(string?)

- Name: `op_Implicit(string?)`
- Modifiers: `static` `nullable`
- Returns: [ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CustomResourceSnapshot.cs#L183)

Convert text to state snapshot. The style will be null by default

```csharp
public record ResourceStateSnapshot
{
    public static implicit operator ResourceStateSnapshot?(
        string? s)
    {
        // ...
    }
}
```

## Parameters

- `s` (`string?`)

## op_Inequality(ResourceStateSnapshot?, ResourceStateSnapshot?)

- Name: `op_Inequality(ResourceStateSnapshot?, ResourceStateSnapshot?)`
- Modifiers: `static`
- Returns: `bool`

```csharp
public record ResourceStateSnapshot
{
    public static bool operator !=(
        ResourceStateSnapshot? left,
        ResourceStateSnapshot? right)
    {
        // ...
    }
}
```

## Parameters

- `left` ([ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md))
- `right` ([ResourceStateSnapshot?](/reference/api/csharp/aspire.hosting/resourcestatesnapshot.md))

## ToString

- Name: `ToString`
- Modifiers: `override`
- Returns: `string`

Returns a string that represents the current object.

```csharp
public record ResourceStateSnapshot
{
    public override string ToString()
    {
        // ...
    }
}
```

## Returns

`string` -- A string that represents the current object.
