Class CosmosRegistrationHelper
Inheritance
CosmosRegistrationHelper
Assembly: Benday.CosmosDb.dll
Syntax
public class CosmosRegistrationHelper
Constructors
|
Edit this page
View Source
CosmosRegistrationHelper(IServiceCollection, CosmosConfig)
Declaration
public CosmosRegistrationHelper(IServiceCollection services, CosmosConfig config)
Parameters
Properties
|
Edit this page
View Source
AllowBulkExecution
Declaration
public bool AllowBulkExecution { get; }
Property Value
|
Edit this page
View Source
Configuration
Declaration
public CosmosConfig? Configuration { get; }
Property Value
|
Edit this page
View Source
ConnectionString
Declaration
public string ConnectionString { get; }
Property Value
|
Edit this page
View Source
ContainerName
Declaration
public string ContainerName { get; }
Property Value
|
Edit this page
View Source
DatabaseName
Declaration
public string DatabaseName { get; }
Property Value
|
Edit this page
View Source
PartitionKey
Declaration
public string PartitionKey { get; }
Property Value
|
Edit this page
View Source
UseDefaultAzureCredential
Declaration
public bool UseDefaultAzureCredential { get; }
Property Value
|
Edit this page
View Source
UseGatewayMode
Declaration
public bool UseGatewayMode { get; }
Property Value
|
Edit this page
View Source
UseHierarchicalPartitionKey
Declaration
public bool UseHierarchicalPartitionKey { get; }
Property Value
|
Edit this page
View Source
WithCreateStructures
Declaration
public bool WithCreateStructures { get; }
Property Value
Methods
|
Edit this page
View Source
RegisterParentedRepositoryAndService<TEntity>()
Registers a repository and service for a parented item entity type using default implementations.
Declaration
public void RegisterParentedRepositoryAndService<TEntity>() where TEntity : ParentedItemBase, new()
Type Parameters
| Name |
Description |
| TEntity |
Entity type that inherits from ParentedItemBase
|
|
Edit this page
View Source
RegisterParentedRepository<TEntity>()
Registers a repository for a specific parented item entity type using default implementation of CosmosDbParentedItemRepository.
Declaration
public void RegisterParentedRepository<TEntity>() where TEntity : ParentedItemBase, new()
Type Parameters
| Name |
Description |
| TEntity |
Entity type that inherits from ParentedItemBase
|
|
Edit this page
View Source
RegisterParentedRepository<TEntity, TInterface, TImplementation>()
Registers a repository for a specific parented item entity type using a custom implementation of the repository.
Declaration
public void RegisterParentedRepository<TEntity, TInterface, TImplementation>() where TEntity : ParentedItemBase, new() where TInterface : class where TImplementation : class, TInterface
Type Parameters
| Name |
Description |
| TEntity |
Entity type that inherits from ParentedItemBase
|
| TInterface |
Repository interface
|
| TImplementation |
Repository implementation
|
|
Edit this page
View Source
RegisterRepositoryAndService<TEntity>()
Registers a repository and service for a domain model entity type using default implementations.
Declaration
public void RegisterRepositoryAndService<TEntity>() where TEntity : TenantItemBase, new()
Type Parameters
|
Edit this page
View Source
RegisterRepository<TEntity>()
Registers a repository for a specific domain model entity type.
Declaration
public void RegisterRepository<TEntity>() where TEntity : TenantItemBase, new()
Type Parameters
|
Edit this page
View Source
RegisterRepository<TEntity, TInterface, TImplementation>()
Registers a repository for a specific domain model entity type using a custom implementation of the repository.
Declaration
public void RegisterRepository<TEntity, TInterface, TImplementation>() where TEntity : TenantItemBase, new() where TInterface : class where TImplementation : class, TInterface
Type Parameters
| Name |
Description |
| TEntity |
|
| TInterface |
|
| TImplementation |
|
|
Edit this page
View Source
RegisterRepository<TEntity, TInterface, TImplementation>(string?, string?, string?, string?, bool?, bool?, bool?)
Registers a repository for a specific domain model entity type using a custom configuration values.
Null or empty values will use the defaults from the helper instance.
Declaration
public void RegisterRepository<TEntity, TInterface, TImplementation>(string? connectionString = null, string? databaseName = null, string? containerName = null, string? partitionKey = null, bool? useHierarchicalPartitionKey = null, bool? useDefaultAzureCredential = null, bool? withCreateStructures = null) where TEntity : TenantItemBase, new() where TInterface : class where TImplementation : class, TInterface
Parameters
| Type |
Name |
Description |
| string |
connectionString |
|
| string |
databaseName |
|
| string |
containerName |
|
| string |
partitionKey |
|
| bool? |
useHierarchicalPartitionKey |
|
| bool? |
useDefaultAzureCredential |
|
| bool? |
withCreateStructures |
|
Type Parameters
| Name |
Description |
| TEntity |
|
| TInterface |
|
| TImplementation |
|
|
Edit this page
View Source
WithQueryLogSink(ICosmosQueryLogSink)
Registers a specific ICosmosQueryLogSink instance to
receive query diagnostics. Useful for test scenarios where a
pre-constructed capture sink should be used.
Declaration
public CosmosRegistrationHelper WithQueryLogSink(ICosmosQueryLogSink sink)
Parameters
Returns
|
Edit this page
View Source
WithQueryLogSink<TSink>()
Declaration
public CosmosRegistrationHelper WithQueryLogSink<TSink>() where TSink : class, ICosmosQueryLogSink
Returns
Type Parameters
| Name |
Description |
| TSink |
The sink implementation type. Registered as a singleton.
|