DistributedApplication Class

Definition

Represents a distributed application that implements the IHost and IAsyncDisposable interfaces.

public class DistributedApplication : IAsyncDisposable, IDisposable, Microsoft.Extensions.Hosting.IHost
type DistributedApplication = class
    interface IHost
    interface IDisposable
    interface IAsyncDisposable
Public Class DistributedApplication
Implements IAsyncDisposable, IDisposable, IHost
Inheritance
DistributedApplication
Implements

Constructors

DistributedApplication(IHost, String[])

Initializes a new instance of the DistributedApplication class.

Properties

Services

Gets the IServiceProvider instance configured for the application.

Methods

CreateBuilder()

Creates a new instance of the IDistributedApplicationBuilder interface.

CreateBuilder(DistributedApplicationOptions)

Creates a new instance of the IDistributedApplicationBuilder interface with the specified options.

CreateBuilder(String[])

Creates a new instance of IDistributedApplicationBuilder with the specified command-line arguments.

Dispose()

Disposes the distributed application by disposing the IHost.

DisposeAsync()

Asynchronously disposes the distributed application by disposing the IHost.

Run()

Runs the distributed application and only completes when the token is triggered or shutdown is triggered.

RunAsync(CancellationToken)

Runs an application and returns a Task that only completes when the token is triggered or shutdown is triggered and all IHostedService instances are stopped.

StartAsync(CancellationToken)

Starts the program.

StopAsync(CancellationToken)

Attempts to gracefully stop the program.

Explicit Interface Implementations

IHost.StartAsync(CancellationToken)
IHost.StopAsync(CancellationToken)

Applies to