Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Class ClusterOptionsExtensions

Extensions for ClusterOptions.

Inheritance
object
ClusterOptionsExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Couchbase
Assembly: Couchbase.NetClient.dll
Syntax
public static class ClusterOptionsExtensions

Methods

View Source

AddClusterService<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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.