Search documentationEsc

ServiceCollectionExtensions

Extension methods for adding and configuring the Azure Cosmos DB services when running on ASP.NET CORE.

Namespace: Microsoft.Azure.CosmosRepository.AspNetCore.Extensions
Kind: class

Extension methods for adding and configuring the Azure Cosmos DB services when running on ASP.NET CORE.

public static class ServiceCollectionExtensions

Example

Members

Methods

ServiceCollectionExtensions.AddCosmosRepositoryChangeFeedHostedService(IServiceCollection)

Adds the hosted service to process changes from any number of cosmos containers.

public static IServiceCollection AddCosmosRepositoryChangeFeedHostedService(this IServiceCollection services)

Parameters

NameTypeDescription
servicesIServiceCollectionThe service collection to add services to.

ReturnsIServiceCollection: The same service collection that was provided, with the CosmosRepositoryChangeFeedHostedService

Please ensure this is called in conjunction with services.AddCosmosRepository(…)

ServiceCollectionExtensions.AddCosmosRepositoryItemChangeFeedProcessors(IServiceCollection, params Assembly[])

Adds the given IItemChangeFeedProcessor defined in the given assemblies.

public static IServiceCollection AddCosmosRepositoryItemChangeFeedProcessors(this IServiceCollection services, params Assembly[] assemblies)

Parameters

NameTypeDescription
servicesIServiceCollectionThe service collection to add services to.
assembliesAssembly[]The assemblies to scan for IItemChangeFeedProcessor’s.

ReturnsIServiceCollection: The same service collection that was provided, with the found IItemChangeFeedProcessor’s registered as singletons.