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
servicesIServiceCollectionThe 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
servicesIServiceCollectionThe service collection to register against.
httpClientNamestringThe name of the HttpClient to resolve from IHttpClientFactory.
Returns
- IServiceCollection
The same service collection instance.