# PipelineStepAnnotation Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [PipelineStepAnnotation](/reference/api/csharp/aspire.hosting/pipelinestepannotation.md)
- Kind: `Constructors`
- Members: `4`

An annotation that creates pipeline steps for a resource during deployment.

## PipelineStepAnnotation(Func<PipelineStepFactoryContext, PipelineStep>)

- Name: `Constructor(Func<PipelineStepFactoryContext, PipelineStep>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Pipelines/PipelineStepAnnotation.cs)

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

```csharp
public class PipelineStepAnnotation
{
    public PipelineStepAnnotation(
        Func<PipelineStepFactoryContext, PipelineStep> factory)
    {
        // ...
    }
}
```

## Parameters

- `factory` (`Func<PipelineStepFactoryContext, PipelineStep>`)
  A factory function that creates the pipeline step.

## PipelineStepAnnotation(Func<PipelineStepFactoryContext, Task<PipelineStep>>)

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

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

```csharp
public class PipelineStepAnnotation
{
    public PipelineStepAnnotation(
        Func<PipelineStepFactoryContext, Task<PipelineStep>> factory)
    {
        // ...
    }
}
```

## Parameters

- `factory` (`Func<PipelineStepFactoryContext, Task<PipelineStep>>`)
  An async factory function that creates the pipeline step.

## PipelineStepAnnotation(Func<PipelineStepFactoryContext, IEnumerable<PipelineStep>>)

- Name: `Constructor(Func<PipelineStepFactoryContext, IEnumerable<PipelineStep>>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Pipelines/PipelineStepAnnotation.cs)

Initializes a new instance of the [PipelineStepAnnotation](/reference/api/csharp/aspire.hosting/pipelinestepannotation.md) class with a factory that creates multiple pipeline steps.

```csharp
public class PipelineStepAnnotation
{
    public PipelineStepAnnotation(
        Func<PipelineStepFactoryContext, IEnumerable<PipelineStep>> factory)
    {
        // ...
    }
}
```

## Parameters

- `factory` (`Func<PipelineStepFactoryContext, IEnumerable<PipelineStep>>`)
  A factory function that creates multiple pipeline steps.

## PipelineStepAnnotation(Func<PipelineStepFactoryContext, Task<IEnumerable<PipelineStep>>>)

- Name: `Constructor(Func<PipelineStepFactoryContext, Task<IEnumerable<PipelineStep>>>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Pipelines/PipelineStepAnnotation.cs)

Initializes a new instance of the [PipelineStepAnnotation](/reference/api/csharp/aspire.hosting/pipelinestepannotation.md) class with a factory that creates multiple pipeline steps.

```csharp
public class PipelineStepAnnotation
{
    public PipelineStepAnnotation(
        Func<PipelineStepFactoryContext, Task<IEnumerable<PipelineStep>>> factory)
    {
        // ...
    }
}
```

## Parameters

- `factory` (`Func<PipelineStepFactoryContext, Task<IEnumerable<PipelineStep>>>`)
  An async factory function that creates multiple pipeline steps.
