Class ClusterOptionsExtensions
Extensions for Cluster
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 Cluster
Declaration
public static ClusterOptions AddClusterService<T>(this ClusterOptions clusterOptions, T singleton) where T : notnull
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
T | singleton | Singleton instance which is always returned. |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
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 Cluster
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions) where TImplementation : TService
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
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 Cluster
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions, Func<IServiceProvider, TImplementation> factory) where TImplementation : notnull, TService
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
Func<IService |
factory | Factory which creates the service the first time it is requested. |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
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 Cluster
Declaration
public static ClusterOptions AddClusterService<TService, TImplementation>(this ClusterOptions clusterOptions, TImplementation singleton) where TImplementation : notnull, TService
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
TImplementation | singleton | Singleton instance which is always returned. |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
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 Cluster
Declaration
public static ClusterOptions AddTransientService<TService, TImplementation>(this ClusterOptions clusterOptions) where TImplementation : TService
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
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 Cluster
Declaration
public static ClusterOptions AddTransientService<TService, TImplementation>(this ClusterOptions clusterOptions, Func<IServiceProvider, TImplementation> factory) where TImplementation : notnull, TService
Parameters
Type | Name | Description |
---|---|---|
Cluster |
clusterOptions | The Cluster |
Func<IService |
factory | Factory which creates the service each time it is requested. |
Returns
Type | Description |
---|---|
Cluster |
The Cluster |
Type Parameters
Name | Description |
---|---|
TService | The type of the service which will be requested. |
TImplementation | The type of the service implementation which is returned. |