Class ClusterOptionsExtensions
Extensions for ClusterOptions.
Inherited Members
Namespace: Couchbase
Assembly: Couchbase.NetClient.dll
Syntax
public static class ClusterOptionsExtensions
Methods
| Edit this page View SourceAddClusterService<T>(ClusterOptions, T)
Register a singleton service with the cluster's ClusterServices.
Declaration
public static ClusterOptions AddClusterService<T>(this ClusterOptions clusterOptions, T singleton) where T : notnull
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
| T | singleton | Singleton instance which is always returned. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the service which will be requested and returned. |
AddClusterService<TService, TImplementation>(ClusterOptions)
Register a service with the cluster's ClusterServices using the cluster's lifetime.
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions) where TImplementation : TService
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service which will be requested. |
| TImplementation | The type of the service implementation which is returned. |
AddClusterService<TService, TImplementation>(ClusterOptions, Func<IServiceProvider, TImplementation>)
Register a service with the cluster's ClusterServices using the cluster's lifetime.
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions, Func<IServiceProvider, TImplementation> factory) where TImplementation : notnull, TService
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
| Func<IServiceProvider, TImplementation> | factory | Factory which creates the service the first time it is requested. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service which will be requested. |
| TImplementation | The type of the service implementation which is returned. |
AddClusterService<TService, TImplementation>(ClusterOptions, TImplementation)
Register a singleton service with the cluster's ClusterServices.
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions, TImplementation singleton) where TImplementation : notnull, TService
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
| TImplementation | singleton | Singleton instance which is always returned. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service which will be requested. |
| TImplementation | The type of the service implementation which is returned. |
AddTransientService<TService, TImplementation>(ClusterOptions)
Register a transient service with the cluster's ClusterServices.
Declaration
public static ClusterOptions AddTransientService<TService, TImplementation>(this ClusterOptions clusterOptions) where TImplementation : TService
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service which will be requested. |
| TImplementation | The type of the service implementation which is returned. |
AddTransientService<TService, TImplementation>(ClusterOptions, Func<IServiceProvider, TImplementation>)
Register a transient service with the cluster's ClusterServices.
Declaration
public static ClusterOptions AddTransientService<TService, TImplementation>(this ClusterOptions clusterOptions, Func<IServiceProvider, TImplementation> factory) where TImplementation : notnull, TService
Parameters
| Type | Name | Description |
|---|---|---|
| ClusterOptions | clusterOptions | The ClusterOptions. |
| Func<IServiceProvider, TImplementation> | factory | Factory which creates the service each time it is requested. |
Returns
| Type | Description |
|---|---|
| ClusterOptions | The ClusterOptions. |
Type Parameters
| Name | Description |
|---|---|
| TService | The type of the service which will be requested. |
| TImplementation | The type of the service implementation which is returned. |