Table of Contents

Class PnPContextFactoryCollectionExtensions

Namespace
PnP.Core.Services
Assembly
PnP.Core.dll

Extension class for the IServiceCollection type to provide supporting methods for the PnPContextFactory service

public static class PnPContextFactoryCollectionExtensions
Inheritance
PnPContextFactoryCollectionExtensions
Inherited Members

Methods

AddPnPContextFactory(IServiceCollection, Action<IHttpClientBuilder>, Action<IHttpClientBuilder>)

Adds the PnPContextFactory to the collection of services

public static IServiceCollection AddPnPContextFactory(this IServiceCollection collection, Action<IHttpClientBuilder> configureSharePointRest = null, Action<IHttpClientBuilder> configureMicrosoftGraph = null)

Parameters

collection IServiceCollection

Collection of loaded services

configureSharePointRest Action<IHttpClientBuilder>

additional configuration to SharePointRestClient

configureMicrosoftGraph Action<IHttpClientBuilder>

additional configuration to MicrosoftGraphClient

Returns

IServiceCollection

Collection of loaded services

Remarks

Optional additional configuration can be provided for SharePointRestClient and/or MicrosoftGraphClient

AddPnPContextFactory(IServiceCollection, Action<PnPContextFactoryOptions>, Action<IHttpClientBuilder>, Action<IHttpClientBuilder>)

Adds the PnPContextFactory to the collection of services with options.

public static IServiceCollection AddPnPContextFactory(this IServiceCollection collection, Action<PnPContextFactoryOptions> options, Action<IHttpClientBuilder> configureSharePointRest = null, Action<IHttpClientBuilder> configureMicrosoftGraph = null)

Parameters

collection IServiceCollection

Collection of loaded services

options Action<PnPContextFactoryOptions>

PnPContextFactory configuration options

configureSharePointRest Action<IHttpClientBuilder>

additional configuration to SharePointRestClient

configureMicrosoftGraph Action<IHttpClientBuilder>

additional configuration to MicrosoftGraphClient

Returns

IServiceCollection

Collection of loaded services

Remarks

Optional additional configuration can be provided for SharePointRestClient and/or MicrosoftGraphClient