Show / Hide Table of Contents

Class CosmosDiagnosticsRegistry

Singleton registry that holds per-entity-type diagnostic options for CosmosRepository<T>. Repositories resolve this from DI in their constructor and look up their own options via GetFor<TEntity>().

Inheritance
object
CosmosDiagnosticsRegistry
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CosmosDb.Diagnostics
Assembly: Benday.CosmosDb.dll
Syntax
public sealed class CosmosDiagnosticsRegistry
Remarks

Configure through ConfigureDiagnostics<TEntity>(Action<CosmosRepositoryDiagnosticsOptions>) or ConfigureDiagnosticsDefault(Action<CosmosRepositoryDiagnosticsOptions>) — those helpers add or fetch the singleton from the service collection and mutate it. Direct use of Set<TEntity>(Action<CosmosRepositoryDiagnosticsOptions>) / SetDefault(Action<CosmosRepositoryDiagnosticsOptions>) is supported but not the typical path.

Methods

| Edit this page View Source

GetFor<TEntity>()

Returns the options for TEntity. If the entity has no per-entity entry, returns the registry default. Never returns null.

Declaration
public CosmosRepositoryDiagnosticsOptions GetFor<TEntity>()
Returns
Type Description
CosmosRepositoryDiagnosticsOptions
Type Parameters
Name Description
TEntity
| Edit this page View Source

SetDefault(Action<CosmosRepositoryDiagnosticsOptions>)

Applies configure to the registry default. The default is returned by GetFor<TEntity>() for any entity type that has not been configured explicitly.

Declaration
public void SetDefault(Action<CosmosRepositoryDiagnosticsOptions> configure)
Parameters
Type Name Description
Action<CosmosRepositoryDiagnosticsOptions> configure
| Edit this page View Source

Set<TEntity>(Action<CosmosRepositoryDiagnosticsOptions>)

Applies configure to the options for TEntity, creating an entry if one doesn't already exist.

Declaration
public void Set<TEntity>(Action<CosmosRepositoryDiagnosticsOptions> configure)
Parameters
Type Name Description
Action<CosmosRepositoryDiagnosticsOptions> configure
Type Parameters
Name Description
TEntity
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com