# ContainerImagePushOptionsCallbackAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ContainerImagePushOptionsCallbackAnnotation](/reference/api/csharp/aspire.hosting/containerimagepushoptionscallbackannotation.md)
- Kind: `Constructors`
- Members: `2`

Represents an annotation that configures container image push options via a callback function.

## ContainerImagePushOptionsCallbackAnnotation(Action<ContainerImagePushOptionsCallbackContext>)

- Name: `Constructor(Action<ContainerImagePushOptionsCallbackContext>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerImagePushOptionsCallbackAnnotation.cs)

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

```csharp
public sealed class ContainerImagePushOptionsCallbackAnnotation
{
    public ContainerImagePushOptionsCallbackAnnotation(
        Action<ContainerImagePushOptionsCallbackContext> callback)
    {
        // ...
    }
}
```

## Parameters

- `callback` (`Action<ContainerImagePushOptionsCallbackContext>`)
  The synchronous callback to configure push options.

## Exceptions

- `ArgumentNullException` -- Thrown when `callback` is `null`.

## ContainerImagePushOptionsCallbackAnnotation(Func<ContainerImagePushOptionsCallbackContext, Task>)

- Name: `Constructor(Func<ContainerImagePushOptionsCallbackContext, Task>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/ContainerImagePushOptionsCallbackAnnotation.cs)

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

```csharp
public sealed class ContainerImagePushOptionsCallbackAnnotation
{
    public ContainerImagePushOptionsCallbackAnnotation(
        Func<ContainerImagePushOptionsCallbackContext, Task> callback)
    {
        // ...
    }
}
```

## Parameters

- `callback` (`Func<ContainerImagePushOptionsCallbackContext, Task>`)
  The asynchronous callback to configure push options.

## Exceptions

- `ArgumentNullException` -- Thrown when `callback` is `null`.
