Skip to main content

Definition

Assembly: Microsoft.Extensions.Hosting.Abstractions.dll Namespace: Microsoft.Extensions.Hosting

Syntax

Microsoft.Extensions.Hosting.IHostBuilder

Summary

This type is defined in Microsoft.Extensions.Hosting.Abstractions.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

UseAmazonSQSMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Amazon_IHostBuilderExtensions
Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the AmazonSQSMessagePublisher with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAmazonSQSMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_Amazon_IHostBuilderExtensions
Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the AmazonSQSMessagePublisher with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Amazon.Core.AmazonSQSOptions> amazonSQSOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
amazonSQSOptionsSystem.Action<CloudNimble.SimpleMessageBus.Amazon.Core.AmazonSQSOptions>An Action`1 that gives you a fluent interface for configuring the options for a queue backed by Amazon SQS.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAmazonSQSProcessor Extension

Extension method from Microsoft.Extensions.Hosting.DispatchAmazon_IHostBuilderExtensions
Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the AmazonSQSProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAmazonSQSProcessor Extension

Extension method from Microsoft.Extensions.Hosting.DispatchAmazon_IHostBuilderExtensions
Configures SimpleMessageBus to use Amazon SQS as the backing queue and registers the AmazonSQSProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAmazonSQSProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Amazon.Core.AmazonSQSOptions> amazonSQSOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
amazonSQSOptionsSystem.Action<CloudNimble.SimpleMessageBus.Amazon.Core.AmazonSQSOptions>An Action`1 that gives you a fluent interface for configuring the options for a queue backed by Amazon SQS.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAzureStorageQueueMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAzureStorageQueueMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Core.AzureStorageQueueOptions> azureQueueOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
azureQueueOptionsSystem.Action<CloudNimble.SimpleMessageBus.Core.AzureStorageQueueOptions>-

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAzureStorageQueueProcessor Extension

Extension method from Microsoft.Extensions.Hosting.IHostBuilderExtensions
Configures SimpleMessageBus to use Azure Storage Queues as the backing queue and registers the AzureStorageQueueProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseAzureStorageQueueProcessor Extension

Extension method from Microsoft.Extensions.Hosting.IHostBuilderExtensions
Configures SimpleMessageBus to use Azure Storage Queues as the backing queue and registers the AzureStorageQueueProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseAzureStorageQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Core.AzureStorageQueueOptions> azureQueueOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
azureQueueOptionsSystem.Action<CloudNimble.SimpleMessageBus.Core.AzureStorageQueueOptions>An Action`1 that gives you a fluent interface for configuring the options for a queue backed by Azure Queue Storage.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseFileSystemMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseFileSystemMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IHostBuilderExtensions

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Core.FileSystemOptions> fileSystemOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
fileSystemOptionsSystem.Action<CloudNimble.SimpleMessageBus.Core.FileSystemOptions>-

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseFileSystemQueueProcessor Extension

Extension method from Microsoft.Extensions.Hosting.FileSystem_IHostBuilderExtensions
Configures SimpleMessageBus to use the local file system as the backing queue and registers the FileSystemQueueProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseFileSystemQueueProcessor Extension

Extension method from Microsoft.Extensions.Hosting.FileSystem_IHostBuilderExtensions
Configures SimpleMessageBus to use the local file system as the backing queue and registers the FileSystemQueueProcessor with the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseFileSystemQueueProcessor(Microsoft.Extensions.Hosting.IHostBuilder builder, System.Action<CloudNimble.SimpleMessageBus.Core.FileSystemOptions> fileSystemOptions)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
fileSystemOptionsSystem.Action<CloudNimble.SimpleMessageBus.Core.FileSystemOptions>An Action`1 that gives you a fluent interface for configuring the options for a queue backed by the file system..

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseIndexedDbMessagePublisher Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Publish_IndexedDb_IHostBuilderExtensions

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseIndexedDbMessagePublisher(Microsoft.Extensions.Hosting.IHostBuilder builder, string configSectionName = "SimpleMessageBus:IndexedDb", System.Action<CloudNimble.SimpleMessageBus.IndexedDb.Core.IndexedDbOptions> indexedDbOptions = null)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.
configSectionNamestringThe name of the ConfigurationSection to load the IndexedDbOptions from. Defaults to ‘SimpleMessageBus:IndexedDb’.
indexedDbOptionsSystem.Action<CloudNimble.SimpleMessageBus.IndexedDb.Core.IndexedDbOptions>An Action`1 lambda that allows you to set the IndexedDbOptions inline.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent configuration.

UseOrderedMessageDispatcher Extension

Extension method from Microsoft.Extensions.Hosting.IHostBuilderExtensions
Configures SimpleMessageBus to use the OrderedMessageDispatcher, which processes registered IMessageHandlerIMessageHandlers</see> in series based on the order they were registered in the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseOrderedMessageDispatcher(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseParallelMessageDispatcher Extension

Extension method from Microsoft.Extensions.Hosting.IHostBuilderExtensions
Configures SimpleMessageBus to use the ParallelMessageDispatcher, which processes registered IMessageHandlerIMessageHandlers</see> in parallel regardless of the order the order they were registered in the DI container.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseParallelMessageDispatcher(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

UseSimpleMessageBusLifetime Extension

Extension method from Microsoft.Extensions.Hosting.SimpleMessageBus_Hosting_IHostBuilderExtensions
Configures SimpleMessageBus to use either the WindowsServiceLifetime or the ConsoleLifetime depending on the currently-running context.

Syntax

public static Microsoft.Extensions.Hosting.IHostBuilder UseSimpleMessageBusLifetime(Microsoft.Extensions.Hosting.IHostBuilder builder)

Parameters

NameTypeDescription
builderMicrosoft.Extensions.Hosting.IHostBuilderThe IHostBuilder instance to extend.

Returns

Type: Microsoft.Extensions.Hosting.IHostBuilder The IHostBuilder instance being configured, for fluent interaction.

Remarks

This method automatically detects whether the application is running as a Windows Service and configures the appropriate lifetime management. This enables the same application to run seamlessly in both development (console) and production (service) environments.