Interface IPnPContextFactory
Public interface for the injectable service to create an PnPContext
Namespace: PnP.Core.Services
Assembly: PnP.Core.dll
Syntax
public interface IPnPContextFactory
Properties
EventHub
Gets the EventHub instance, can be used to tap into events like request retry (due to throttling)
Declaration
EventHub EventHub { get; }
Property Value
EventHub
|
Methods
Create(Guid, CancellationToken, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and using the default Authentication Provider
Declaration
PnPContext Create(Guid groupId, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Guid groupId, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options used to configure the created context |
Returns
PnPContext
A PnPContext object based on the provided configuration name |
Create(Guid, IAuthenticationProvider, PnPContextOptions)
Creates a new instance of PnPContext based on a provided group and Authentication Provider instance
Declaration
PnPContext Create(Guid groupId, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Guid groupId, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
Action<IAuthenticationProvider>
initializeAuthenticationProvider
The function to initialize the context |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
Action<IAuthenticationProvider>
initializeAuthenticationProvider
The function to initialize the context |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(string name, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(string name, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Uri url, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Uri url, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Uri url, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
PnPContextOptions
options
Options 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
Declaration
PnPContext Create(Uri url, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
PnPContextOptions
options
Options used to configure the created context |
Returns
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
Declaration
Task<PnPContext> CreateAsync(Guid groupId, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Guid groupId, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options used to configure the created context |
Returns
Task<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
Declaration
Task<PnPContext> CreateAsync(Guid groupId, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Guid groupId, PnPContextOptions options = null)
Parameters
Guid
groupId
The id of an Microsoft 365 group |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
Action<IAuthenticationProvider>
initializeAuthenticationProvider
The function to initialize the context |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(string name, Action<IAuthenticationProvider> initializeAuthenticationProvider, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
Action<IAuthenticationProvider>
initializeAuthenticationProvider
The function to initialize the context |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(string name, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(string name, PnPContextOptions options = null)
Parameters
System.String
name
The name of the configuration to use |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Uri url, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Uri url, IAuthenticationProvider authenticationProvider, CancellationToken cancellationToken, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
CancellationToken
cancellationToken
The cancellation token to cancel operation |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Uri url, IAuthenticationProvider authenticationProvider, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
IAuthenticationProvider
authenticationProvider
The Authentication Provider to use to authenticate within the PnPContext |
PnPContextOptions
options
Options 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
Declaration
Task<PnPContext> CreateAsync(Uri url, PnPContextOptions options = null)
Parameters
Uri
url
The URL of the PnPContext as a URI |
PnPContextOptions
options
Options used to configure the created context |
Returns
Task<PnPContext>
A PnPContext object based on the provided configuration name |