Interface IPnPContextFactory
Public interface for the injectable service to create an PnPContext
public interface IPnPContextFactory
Properties
EventHub
Gets the EventHub instance, can be used to tap into events like request retry (due to throttling)
EventHub EventHub { get; }
Property Value
Methods
Create(Guid, IAuthenticationProvider, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and Authentication Provider instance
PnPContext Create(Guid groupId, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Guid, IAuthenticationProvider, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and Authentication Provider instance
PnPContext Create(Guid groupId, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Guid, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and using the default Authentication Provider
PnPContext Create(Guid groupId, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Guid, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and using the default Authentication Provider
PnPContext Create(Guid groupId, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(string, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name
PnPContext Create(string name, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(string, Action<IAuthenticationProvider>, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name and on a custom initialization function for the IAuthenticationProvider reference instance
PnPContext Create(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
initializeAuthenticationProviderAction<IAuthenticationProvider>The function to initialize the context
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(string, Action<IAuthenticationProvider>, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name and on a custom initialization function for the IAuthenticationProvider reference instance
PnPContext Create(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
initializeAuthenticationProviderAction<IAuthenticationProvider>The function to initialize the context
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(string, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name
PnPContext Create(string name, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Uri, IAuthenticationProvider, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and Authentication Provider instance
PnPContext Create(Uri url, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Uri, IAuthenticationProvider, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and Authentication Provider instance
PnPContext Create(Uri url, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Uri, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and using the default Authentication Provider
PnPContext Create(Uri url, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
Create(Uri, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and using the default Authentication Provider
PnPContext Create(Uri url, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- PnPContext
A PnPContext object based on the provided configuration name
CreateAsync(Guid, IAuthenticationProvider, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and Authentication Provider instance
Task<PnPContext> CreateAsync(Guid groupId, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Guid, IAuthenticationProvider, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and Authentication Provider instance
Task<PnPContext> CreateAsync(Guid groupId, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Guid, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and using the default Authentication Provider
Task<PnPContext> CreateAsync(Guid groupId, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Guid, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and using the default Authentication Provider
Task<PnPContext> CreateAsync(Guid groupId, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
groupIdGuidThe id of an Microsoft 365 group
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(string, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name
Task<PnPContext> CreateAsync(string name, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(string, Action<IAuthenticationProvider>, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name and on a custom initialization function for the IAuthenticationProvider reference instance
Task<PnPContext> CreateAsync(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
initializeAuthenticationProviderAction<IAuthenticationProvider>The function to initialize the context
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(string, Action<IAuthenticationProvider>, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name and on a custom initialization function for the IAuthenticationProvider reference instance
Task<PnPContext> CreateAsync(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
initializeAuthenticationProviderAction<IAuthenticationProvider>The function to initialize the context
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(string, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided configuration name
Task<PnPContext> CreateAsync(string name, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
namestringThe name of the configuration to use
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Uri, IAuthenticationProvider, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and Authentication Provider instance
Task<PnPContext> CreateAsync(Uri url, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Uri, IAuthenticationProvider, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and Authentication Provider instance
Task<PnPContext> CreateAsync(Uri url, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
authenticationProviderIAuthenticationProviderThe Authentication Provider to use to authenticate within the PnPContext
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Uri, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and using the default Authentication Provider
Task<PnPContext> CreateAsync(Uri url, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name
CreateAsync(Uri, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided URL and using the default Authentication Provider
Task<PnPContext> CreateAsync(Uri url, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
urlUriThe URL of the PnPContext as a URI
cancellationTokenCancellationTokenThe cancellation token to cancel operation
optionsPnPContextOptionsOptions used to configure the created context
Returns
- Task<PnPContext>
A PnPContext object based on the provided configuration name