# ResourceCommandAnnotation

- Kind: `class`
- 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/ResourceCommandAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

Represents a command annotation for a resource.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class ResourceCommandAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Constructors

- [ResourceCommandAnnotation(string, string, Func<UpdateCommandStateContext, ResourceCommandState>, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, string?, object?, string?, string?, IconVariant?, bool)](/reference/api/csharp/aspire.hosting/resourcecommandannotation/constructors.md#constructor-string-string-func-updatecommandstatecontext-resourcecommandstate-func-executecommandcontext-task-executecommandresult-string-object-string-string-iconvariant-bool) -- Initializes a new instance of the [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md) class.

## Properties

- [ConfirmationMessage](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#confirmationmessage) : `string?` `get` -- When a confirmation message is specified, the UI will prompt with an OK/Cancel dialog and the confirmation message before starting the command.
- [DisplayDescription](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#displaydescription) : `string?` `get` -- Optional description of the command, to be shown in the UI. Could be used as a tooltip. May be localized.
- [DisplayName](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#displayname) : `string` `get` -- The display name visible in UI.
- [ExecuteCommand](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#executecommand) : `Func<ExecuteCommandContext, Task<ExecuteCommandResult>>` `get` -- A callback that is executed when the command is executed. The result is used to indicate success or failure in the UI.
- [IconName](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#iconname) : `string?` `get` -- The icon name for the command. The name should be a valid FluentUI icon name. https://aka.ms/fluentui-system-icons
- [IconVariant](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#iconvariant) : [IconVariant?](/reference/api/csharp/aspire.hosting/iconvariant.md) `get` -- The icon variant for the command.
- [IsHighlighted](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#ishighlighted) : `bool` `get` -- A flag indicating whether the command is highlighted in the UI.
- [Name](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#name) : `string` `get` -- The name of command. The name uniquely identifies the command.
- [Parameter](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#parameter) : `object?` `get` -- Optional parameter that configures the command in some way. Clients must return any value provided by the server when invoking the command.
- [UpdateState](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#updatestate) : `Func<UpdateCommandStateContext, ResourceCommandState>` `get` -- A callback that is used to update the command state. The callback is executed when the command's resource snapshot is updated.
