Class ServiceCollectionExtensions
Extensions to
Namespace: Couchbase.Extensions.DependencyInjection
Assembly: Couchbase.Extensions.DependencyInjection.dll
Syntax
public static class ServiceCollectionExtensions : object
Methods
| Improve this Doc View SourceAddCouchbase(IServiceCollection, IConfiguration)
Add Couchbase dependencies to the
Declaration
public static IServiceCollection AddCouchbase(this IServiceCollection services, IConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
IConfiguration | configuration | Section from the configuration that can be bound to ClusterOptions. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
AddCouchbase(IServiceCollection, Nullable<Action<ClusterOptions>>)
Add Couchbase dependencies to the
Declaration
public static IServiceCollection AddCouchbase(this IServiceCollection services, Action<ClusterOptions>? options)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<Action<ClusterOptions>> | options | Optional action to configure the ClusterOptions. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
AddCouchbaseBucket<T>(IServiceCollection, String)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name.
Declaration
public static IServiceCollection AddCouchbaseBucket<T>(this IServiceCollection services, string bucketName)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
String | bucketName | The name of the Couchbase bucket. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
AddCouchbaseBucket<T>(IServiceCollection, String, Nullable<Action<IBucketBuilder>>)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name.
Declaration
public static IServiceCollection AddCouchbaseBucket<T>(this IServiceCollection services, string bucketName, Action<IBucketBuilder>? buildAction)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
String | bucketName | The name of the Couchbase bucket. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
AddCouchbaseBucket<TService, TImplementation>(IServiceCollection, Nullable<Action<IBucketBuilder>>)
Register an bucket via an interface inherited from INamedBucketProvider and a concrete implementation of that interface.
Declaration
public static IServiceCollection AddCouchbaseBucket<TService, TImplementation>(this IServiceCollection services, Action<IBucketBuilder>? buildAction = null)
where TService : class, INamedBucketProvider where TImplementation : class, TService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
TService | Interface inherited from INamedBucketProvider. |
TImplementation | Concrete implementation of |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
AddKeyedCouchbase(IServiceCollection, Nullable<String>, IConfiguration)
Add Couchbase dependencies to the
Declaration
public static IServiceCollection AddKeyedCouchbase(this IServiceCollection services, string? serviceKey, IConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
IConfiguration | configuration | Section from the configuration that can be bound to ClusterOptions. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
AddKeyedCouchbase(IServiceCollection, Nullable<String>, Nullable<Action<ClusterOptions>>)
Add Couchbase dependencies to the
Declaration
public static IServiceCollection AddKeyedCouchbase(this IServiceCollection services, string? serviceKey, Action<ClusterOptions>? options)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
Nullable<Action<ClusterOptions>> | options | Optional action to configure the ClusterOptions. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
AddKeyedCouchbaseBucket<T>(IServiceCollection, Nullable<String>, Nullable<String>, Nullable<Action<IBucketBuilder>>)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name.
Declaration
public static IServiceCollection AddKeyedCouchbaseBucket<T>(this IServiceCollection services, string? serviceKey, string? bucketName, Action<IBucketBuilder>? buildAction)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
Nullable<String> | bucketName | The name of the Couchbase bucket. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
AddKeyedCouchbaseBucket<T>(IServiceCollection, Nullable<String>, String)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name.
Declaration
public static IServiceCollection AddKeyedCouchbaseBucket<T>(this IServiceCollection services, string? serviceKey, string bucketName)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
String | bucketName | The name of the Couchbase bucket. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
AddKeyedCouchbaseBucket<TService, TImplementation>(IServiceCollection, Nullable<String>, Nullable<Action<IBucketBuilder>>)
Register an bucket via an interface inherited from INamedBucketProvider and a concrete implementation of that interface.
Declaration
public static IServiceCollection AddKeyedCouchbaseBucket<TService, TImplementation>(this IServiceCollection services, string? serviceKey, Action<IBucketBuilder>? buildAction = null)
where TService : class, INamedBucketProvider where TImplementation : class, TService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
TService | Interface inherited from INamedBucketProvider. |
TImplementation | Concrete implementation of |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
TryAddCouchbaseBucket<T>(IServiceCollection, String)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name if the interface hasn't already been added.
Declaration
public static IServiceCollection TryAddCouchbaseBucket<T>(this IServiceCollection services, string bucketName)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
String | bucketName | The name of the Couchbase bucket. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
TryAddCouchbaseBucket<T>(IServiceCollection, String, Nullable<Action<IBucketBuilder>>)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name if the interface hasn't already been added.
Declaration
public static IServiceCollection TryAddCouchbaseBucket<T>(this IServiceCollection services, string bucketName, Action<IBucketBuilder>? buildAction)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
String | bucketName | The name of the Couchbase bucket. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
TryAddCouchbaseBucket<TService, TImplementation>(IServiceCollection, Nullable<Action<IBucketBuilder>>)
Register a bucket via an interface inherited from INamedBucketProvider and a concrete implementation of that interface.
Declaration
public static IServiceCollection TryAddCouchbaseBucket<TService, TImplementation>(this IServiceCollection services, Action<IBucketBuilder>? buildAction = null)
where TService : class, INamedBucketProvider where TImplementation : class, TService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
TService | Interface inherited from INamedBucketProvider. |
TImplementation | Concrete implementation of |
TryAddKeyedCouchbaseBucket<T>(IServiceCollection, Nullable<String>, String)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name if the interface hasn't already been added.
Declaration
public static IServiceCollection TryAddKeyedCouchbaseBucket<T>(this IServiceCollection services, string? serviceKey, string bucketName)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
String | bucketName | The name of the Couchbase bucket. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
TryAddKeyedCouchbaseBucket<T>(IServiceCollection, Nullable<String>, String, Nullable<Action<IBucketBuilder>>)
Register an interface based on INamedBucketProvider which will be injected with a specific bucket name if the interface hasn't already been added.
Declaration
public static IServiceCollection TryAddKeyedCouchbaseBucket<T>(this IServiceCollection services, string? serviceKey, string bucketName, Action<IBucketBuilder>? buildAction)
where T : class, INamedBucketProvider
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
String | bucketName | The name of the Couchbase bucket. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
T | Interface inherited from INamedBucketProvider. Must not add any members. |
Remarks
This method is not AOT-compatible. Use the overload that accepts a concrete implementation.
TryAddKeyedCouchbaseBucket<TService, TImplementation>(IServiceCollection, Nullable<String>, Nullable<Action<IBucketBuilder>>)
Register a bucket via an interface inherited from INamedBucketProvider and a concrete implementation of that interface.
Declaration
public static IServiceCollection TryAddKeyedCouchbaseBucket<TService, TImplementation>(this IServiceCollection services, string? serviceKey, Action<IBucketBuilder>? buildAction = null)
where TService : class, INamedBucketProvider where TImplementation : class, TService
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Nullable<String> | serviceKey | Service key to uniquely represent the cluster. |
Nullable<Action<IBucketBuilder>> | buildAction | Action to perform further configuration. |
Returns
Type | Description |
---|---|
IServiceCollection | The |
Type Parameters
Name | Description |
---|---|
TService | Interface inherited from INamedBucketProvider. |
TImplementation | Concrete implementation of |