# NamedServiceConfiguratorExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.hosting.namedserviceconfiguratorextensions/)

## Configure(INamedServiceConfigurator, Action&lt;OptionsBuilder&lt;TOptions&gt;&gt;) {#configure-1-this-orleans-hosting-inamedserviceconfigurator-system-action-microso-6e7b58c4}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.hosting.namedserviceconfiguratorextensions/methods/configure-1-this-orleans-hosting-inamedserviceconfigurator-system-action-microso-6e7b58c4/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/NamedServiceConfigurator.cs#L74-L79)

```csharp
public static void Configure<TOptions>(this INamedServiceConfigurator configurator, Action<OptionsBuilder<TOptions>> configureOptions)
```

Configures options for a named service.

### Parameters

- `configurator` (`INamedServiceConfigurator`): The named service configurator.
- `configureOptions` (`Action<OptionsBuilder<TOptions>>`): The options configuration delegate.

## ConfigureComponent(INamedServiceConfigurator, Func&lt;IServiceProvider, string, TComponent&gt;) {#configurecomponent-1-this-orleans-hosting-inamedserviceconfigurator-system-func-c6587198}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.hosting.namedserviceconfiguratorextensions/methods/configurecomponent-1-this-orleans-hosting-inamedserviceconfigurator-system-func-c6587198/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/NamedServiceConfigurator.cs#L106-L110)

```csharp
public static void ConfigureComponent<TComponent>(this INamedServiceConfigurator configurator, Func<IServiceProvider, string, TComponent> factory)
```

Adds a singleton component to a named service.

### Parameters

- `configurator` (`INamedServiceConfigurator`): The named configurator which the component will be configured for.
- `factory` (`Func<IServiceProvider, string, TComponent>`): The factory used to create the component for the named service.

## ConfigureComponent(INamedServiceConfigurator, Func&lt;IServiceProvider, string, TComponent&gt;, Action&lt;OptionsBuilder&lt;TOptions&gt;&gt;) {#configurecomponent-2-this-orleans-hosting-inamedserviceconfigurator-system-func-c64431e5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.hosting.namedserviceconfiguratorextensions/methods/configurecomponent-2-this-orleans-hosting-inamedserviceconfigurator-system-func-c64431e5/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/NamedServiceConfigurator.cs#L93-L95)

```csharp
public static void ConfigureComponent<TOptions, TComponent>(this INamedServiceConfigurator configurator, Func<IServiceProvider, string, TComponent> factory, Action<OptionsBuilder<TOptions>> configureOptions = null)
```

Adds a singleton component to a named service and configures options for the named service.

### Parameters

- `configurator` (`INamedServiceConfigurator`): The named configurator which the component and options will be configured for.
- `factory` (`Func<IServiceProvider, string, TComponent>`): The factory used to create the component for the named service.
- `configureOptions` (`Action<OptionsBuilder<TOptions>>`): The delegate used to configure options for the named service.

## ConfigureLifecycle(INamedServiceConfigurator) {#configurelifecycle-1-this-orleans-hosting-inamedserviceconfigurator-bc5b04c7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.hosting.namedserviceconfiguratorextensions/methods/configurelifecycle-1-this-orleans-hosting-inamedserviceconfigurator-bc5b04c7/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/NamedServiceConfigurator.cs#L115)

```csharp
public static void ConfigureLifecycle<T>(this INamedServiceConfigurator configurator)
```

### Parameters

- `configurator` (`INamedServiceConfigurator`)
