# ServiceCollectionExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.servicecollectionextensions/)

## AddDashboard(IClientBuilder, Action&lt;DashboardOptions&gt;) {#adddashboard-this-orleans-hosting-iclientbuilder-system-action-orleans-dashboard-1ead58b2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.servicecollectionextensions/methods/adddashboard-this-orleans-hosting-iclientbuilder-system-action-orleans-dashboard-1ead58b2/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs#L386-L392)

```csharp
public static IClientBuilder AddDashboard(this IClientBuilder clientBuilder, Action<DashboardOptions>? configureOptions = null)
```

Adds Orleans Dashboard services to an Orleans client builder. This allows you to host the Orleans Dashboard application on an Orleans client, so long as the silos also have the dashboard added.

### Parameters

- `clientBuilder` (`IClientBuilder`): The client builder.
- `configureOptions` (`Action<DashboardOptions>`): Optional configuration action for [DashboardOptions](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.dashboardoptions/).

### Returns

The service collection for method chaining.

## AddDashboard(ISiloBuilder, Action&lt;DashboardOptions&gt;) {#adddashboard-this-orleans-hosting-isilobuilder-system-action-orleans-dashboard-d-f1390520}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.servicecollectionextensions/methods/adddashboard-this-orleans-hosting-isilobuilder-system-action-orleans-dashboard-d-f1390520/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs#L39-L40)

```csharp
public static ISiloBuilder AddDashboard(this ISiloBuilder siloBuilder, Action<DashboardOptions>? configureOptions = null)
```

Adds Orleans Dashboard services to the silo builder.

### Parameters

- `siloBuilder` (`ISiloBuilder`): The silo builder.
- `configureOptions` (`Action<DashboardOptions>`): Optional configuration action for [DashboardOptions](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.dashboardoptions/).

### Returns

The silo builder for method chaining.

## MapOrleansDashboard(IEndpointRouteBuilder, string?) {#maporleansdashboard-this-microsoft-aspnetcore-routing-iendpointroutebuilder-stri-63077252}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.dashboard/orleans.dashboard.servicecollectionextensions/methods/maporleansdashboard-this-microsoft-aspnetcore-routing-iendpointroutebuilder-stri-63077252/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Dashboard/Orleans.Dashboard/ServiceCollectionExtensions.cs#L97-L313)

```csharp
public static RouteGroupBuilder MapOrleansDashboard(this IEndpointRouteBuilder endpoints, string? routePrefix = null)
```

Maps Orleans Dashboard endpoints using ASP.NET Core minimal APIs. Returns an `Microsoft.AspNetCore.Builder.IEndpointConventionBuilder` that can be used to apply authentication, authorization, or other endpoint configuration.

### Parameters

- `endpoints` (`IEndpointRouteBuilder`)
- `routePrefix` (`string?`)

### Examples

```csharp
// Basic usage
             app.MapOrleansDashboard();
            
             // With authentication
             app.MapOrleansDashboard().RequireAuthorization();
            
             // With custom base path
             app.MapOrleansDashboard(routePrefix: "/dashboard");
```
