# ResourceCommandAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md)
- Kind: `Constructors`
- Members: `1`

Represents a command annotation for a resource.

## ResourceCommandAnnotation(string, string, Func<UpdateCommandStateContext, ResourceCommandState>, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, string?, object?, string?, string?, IconVariant?, bool)

- Name: `Constructor(string, string, Func<UpdateCommandStateContext, ResourceCommandState>, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, string?, object?, string?, string?, IconVariant?, bool)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs#L18-L45)

Initializes a new instance of the [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md) class.

```csharp
public sealed class ResourceCommandAnnotation
{
    public ResourceCommandAnnotation(
        string name,
        string displayName,
        Func<UpdateCommandStateContext, ResourceCommandState> updateState,
        Func<ExecuteCommandContext, Task<ExecuteCommandResult>> executeCommand,
        string? displayDescription,
        object? parameter,
        string? confirmationMessage,
        string? iconName,
        IconVariant? iconVariant,
        bool isHighlighted)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
- `displayName` (`string`)
- `updateState` (`Func<UpdateCommandStateContext, ResourceCommandState>`)
- `executeCommand` (`Func<ExecuteCommandContext, Task<ExecuteCommandResult>>`)
- `displayDescription` (`string?`)
- `parameter` (`object?`)
- `confirmationMessage` (`string?`)
- `iconName` (`string?`)
- `iconVariant` ([IconVariant?](/reference/api/csharp/aspire.hosting/iconvariant.md))
- `isHighlighted` (`bool`)
