Share via


PublisherDistributedApplicationBuilderExtensions.AddPublisher<TPublisher,TPublisherOptions> Method

Definition

Adds a publisher to the distributed application for use by the Aspire CLI.

public static Aspire.Hosting.IDistributedApplicationBuilder AddPublisher<TPublisher,TPublisherOptions>(this Aspire.Hosting.IDistributedApplicationBuilder builder, string name, Action<TPublisherOptions>? configureOptions = default) where TPublisher : class, Aspire.Hosting.Publishing.IDistributedApplicationPublisher where TPublisherOptions : class;
static member AddPublisher : Aspire.Hosting.IDistributedApplicationBuilder * string * Action<'PublisherOptions (requires 'PublisherOptions : null)> -> Aspire.Hosting.IDistributedApplicationBuilder (requires 'Publisher : null and 'Publisher :> Aspire.Hosting.Publishing.IDistributedApplicationPublisher and 'PublisherOptions : null)
<Extension()>
Public Function AddPublisher(Of TPublisher As {Class, IDistributedApplicationPublisher}, TPublisherOptions As {Class, IDistributedApplicationPublisher}) (builder As IDistributedApplicationBuilder, name As String, Optional configureOptions As Action(Of TPublisherOptions) = Nothing) As IDistributedApplicationBuilder

Type Parameters

TPublisher

The type of the publisher.

TPublisherOptions

The type of the publisher.

Parameters

name
String

The name of the publisher.

configureOptions
Action<TPublisherOptions>

Callback to configure options for the publisher.

Returns

Applies to