Table of Contents

Class ServiceCollectionExtensions

Namespace
Crews.PlanningCenter.Api.Extensions
Assembly
Crews.PlanningCenter.Api.dll

A collection of extension methods for dependency injection via service collections.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddPlanningCenterApi(IServiceCollection)

Registers Planning Center API clients with the given service collection for dependency injection. Configures an HttpClient that forwards the OIDC bearer token from the current HTTP context — intended for use alongside AddPlanningCenterAuthentication().

public static IServiceCollection AddPlanningCenterApi(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection to register against.

Returns

IServiceCollection

The same service collection instance.

AddPlanningCenterApi(IServiceCollection, string)

Registers Planning Center API clients with the given service collection for dependency injection, using an HttpClient resolved from IHttpClientFactory by the given name.

public static IServiceCollection AddPlanningCenterApi(this IServiceCollection services, string httpClientName)

Parameters

services IServiceCollection

The service collection to register against.

httpClientName string

The name of the HttpClient to resolve from IHttpClientFactory.

Returns

IServiceCollection

The same service collection instance.