Class ArcApplication

Namespace
Cratis.Arc
Assembly
Cratis.Arc.Core.dll

Represents an Arc application.

public class ArcApplication : IHost, IDisposable, IAsyncDisposable
Inheritance
ArcApplication
Implements
Inherited Members
Extension Methods

Constructors

ArcApplication(IHost, ArcOptions)

Initializes a new instance of the ArcApplication class.

public ArcApplication(IHost host, ArcOptions options)

Parameters

host IHost

The underlying IHost.

options ArcOptions

The ArcOptions.

Properties

Options

Gets the options for this Arc application.

public ArcOptions Options { get; }

Property Value

ArcOptions

Services

Gets the services configured for the program (for example, using ConfigureServices(Action<HostBuilderContext, IServiceCollection>)).

public IServiceProvider Services { get; }

Property Value

IServiceProvider

Methods

CreateBuilder(string[]?)

Creates a new instance of the ArcApplicationBuilder.

public static ArcApplicationBuilder CreateBuilder(string[]? args = null)

Parameters

args string[]

Command line arguments.

Returns

ArcApplicationBuilder

A new instance of the ArcApplicationBuilder.

Dispose()

public void Dispose()

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

StartAsync(CancellationToken)

Starts the IHostedService objects configured for the program. The application will run until interrupted or until StopApplication() is called.

public Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to abort program start.

Returns

Task

A Task that will be completed when the IHost starts.

StopAsync(CancellationToken)

Attempts to gracefully stop the program.

public Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Used to indicate when stop should no longer be graceful.

Returns

Task

A Task that will be completed when the IHost stops.