# OrleansSiloGenericHostExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/)

## AddOrleans(IServiceCollection, Action&lt;ISiloBuilder&gt;) {#addorleans-this-microsoft-extensions-dependencyinjection-iservicecollection-syst-7548e29c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/addorleans-this-microsoft-extensions-dependencyinjection-iservicecollection-syst-7548e29c/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs#L141-L147)

```csharp
public static IServiceCollection AddOrleans(this IServiceCollection services, Action<ISiloBuilder> configureDelegate)
```

Configures the service collection to host an Orleans silo.

### Parameters

- `services` (`IServiceCollection`): The service collection.
- `configureDelegate` (`Action<ISiloBuilder>`): The delegate used to configure the silo.

### Returns

The service collection.

## UseOrleans(HostApplicationBuilder) {#useorleans-this-microsoft-extensions-hosting-hostapplicationbuilder-be7b0c08}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-hostapplicationbuilder-be7b0c08/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static HostApplicationBuilder UseOrleans(this HostApplicationBuilder hostAppBuilder)
```

Configures the host app builder to host an Orleans silo.

### Parameters

- `hostAppBuilder` (`HostApplicationBuilder`): The host app builder.

### Returns

The host builder.

## UseOrleans(HostApplicationBuilder, Action&lt;ISiloBuilder&gt;) {#useorleans-this-microsoft-extensions-hosting-hostapplicationbuilder-system-actio-dd96b474}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-hostapplicationbuilder-system-actio-dd96b474/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static HostApplicationBuilder UseOrleans(this HostApplicationBuilder hostAppBuilder, Action<ISiloBuilder> configureDelegate)
```

Configures the host builder to host an Orleans silo.

### Parameters

- `hostAppBuilder` (`HostApplicationBuilder`): The host app builder.
- `configureDelegate` (`Action<ISiloBuilder>`): The delegate used to configure the silo.

### Returns

The host builder.

## UseOrleans(IHostApplicationBuilder) {#useorleans-this-microsoft-extensions-hosting-ihostapplicationbuilder-2ff2820e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-ihostapplicationbuilder-2ff2820e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static IHostApplicationBuilder UseOrleans(this IHostApplicationBuilder hostAppBuilder)
```

Configures the host app builder to host an Orleans silo.

### Parameters

- `hostAppBuilder` (`IHostApplicationBuilder`): The host app builder.

### Returns

The host builder.

## UseOrleans(IHostApplicationBuilder, Action&lt;ISiloBuilder&gt;) {#useorleans-this-microsoft-extensions-hosting-ihostapplicationbuilder-system-acti-2470998e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-ihostapplicationbuilder-system-acti-2470998e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static IHostApplicationBuilder UseOrleans(this IHostApplicationBuilder hostAppBuilder, Action<ISiloBuilder> configureDelegate)
```

Configures the host builder to host an Orleans silo.

### Parameters

- `hostAppBuilder` (`IHostApplicationBuilder`): The host app builder.
- `configureDelegate` (`Action<ISiloBuilder>`): The delegate used to configure the silo.

### Returns

The host builder.

## UseOrleans(IHostBuilder, Action&lt;HostBuilderContext, ISiloBuilder&gt;) {#useorleans-this-microsoft-extensions-hosting-ihostbuilder-system-action-microsof-0281f9b9}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-ihostbuilder-system-action-microsof-0281f9b9/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static IHostBuilder UseOrleans(this IHostBuilder hostBuilder, Action<HostBuilderContext, ISiloBuilder> configureDelegate)
```

Configures the host builder to host an Orleans silo.

### Parameters

- `hostBuilder` (`IHostBuilder`): The host builder.
- `configureDelegate` (`Action<HostBuilderContext, ISiloBuilder>`): The delegate used to configure the silo.

### Returns

The host builder.

## UseOrleans(IHostBuilder, Action&lt;ISiloBuilder&gt;) {#useorleans-this-microsoft-extensions-hosting-ihostbuilder-system-action-orleans-1f26bd51}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/microsoft.extensions.hosting.orleanssilogenerichostextensions/methods/useorleans-this-microsoft-extensions-hosting-ihostbuilder-system-action-orleans-1f26bd51/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Hosting/OrleansSiloGenericHostExtensions.cs)

```csharp
public static IHostBuilder UseOrleans(this IHostBuilder hostBuilder, Action<ISiloBuilder> configureDelegate)
```

Configures the host builder to host an Orleans silo.

### Parameters

- `hostBuilder` (`IHostBuilder`): The host builder.
- `configureDelegate` (`Action<ISiloBuilder>`): The delegate used to configure the silo.

### Returns

The host builder.
