Interface IPnPContext
PnPContext interface to support mocking (that's the only reason)
Namespace: PnP.Core.Services
Assembly: PnP.Core.dll
Syntax
public interface IPnPContext
Properties
AuthenticationProvider
Connected authentication provider
Declaration
IAuthenticationProvider AuthenticationProvider { get; }
Property Value
AzureADLoginAuthority
Returns the Azure AD Login authority (e.g. login.microsoftonline.com) to use when Environment is set to Custom
Declaration
string AzureADLoginAuthority { get; }
Property Value
System.
|
ContentTypeHub
Entry point for the ContentTypeHub Object
Declaration
IContentTypeHub ContentTypeHub { get; }
Property Value
CurrentBatch
Current batch, used for implicit batching
Declaration
Batch CurrentBatch { get; }
Property Value
Environment
Returns the used Microsoft 365 cloud environment
Declaration
Microsoft365Environment? Environment { get; }
Property Value
System.
|
GraphAlwaysUseBeta
If true than all requests to Microsoft Graph use the beta endpoint
Declaration
bool GraphAlwaysUseBeta { get; set; }
Property Value
System.
|
GraphCanUseBeta
If true than the Graph beta endpoint is used when there's no other option, default approach stays using the v1 endpoint
Declaration
bool GraphCanUseBeta { get; set; }
Property Value
System.
|
GraphClient
Connected Microsoft Graph client
Declaration
MicrosoftGraphClient GraphClient { get; }
Property Value
GraphFirst
Controls whether the library will try to use Microsoft Graph over REST whenever that's defined in the model
Declaration
bool GraphFirst { get; set; }
Property Value
System.
|
Group
HasPendingRequests
Are there pending requests to execute (in the case of batching)
Declaration
bool HasPendingRequests { get; }
Property Value
System.
|
Logger
Connected logger
Declaration
ILogger Logger { get; }
Property Value
ILogger
|
Me
MicrosoftGraphAuthority
Returns the Microsoft Graph authority (e.g. graph.microsoft.com) to use when Environment is set to Custom
Declaration
string MicrosoftGraphAuthority { get; }
Property Value
System.
|
Properties
Collection for custom properties that you want to attach to a Pn
Declaration
IDictionary<string, object> Properties { get; }
Property Value
IDictionary<System.
|
RestClient
Connected SharePoint REST client
Declaration
SharePointRestClient RestClient { get; }
Property Value
Site
Social
Team
TermStore
Entry point for the TermStore Object
Declaration
ITermStore TermStore { get; }
Property Value
Uri
Uri of the SharePoint site we're working against
Declaration
Uri Uri { get; }
Property Value
Uri
|
Web
Methods
Clone()
Clones this context into a new context for the same SharePoint site
Declaration
PnPContext Clone()
Returns
Pn New Pn |
Clone(Guid)
Clones this context for another SharePoint site
Declaration
PnPContext Clone(Guid groupId)
Parameters
Guid
groupId
Id of the other Microsoft 365 group to create a Pn |
Returns
Pn New Pn |
Clone(String)
Clones this context for another SharePoint site provided as configuration
Declaration
PnPContext Clone(string name)
Parameters
System. The name of the SPOContext configuration to use |
Returns
Pn New Pn |
Clone(Uri)
Clones this context for another SharePoint site
Declaration
PnPContext Clone(Uri uri)
Parameters
Uri
uri
Uri of the other SharePoint site |
Returns
Pn New Pn |
CloneAsync()
Clones this context into a new context for the same SharePoint site
Declaration
Task<PnPContext> CloneAsync()
Returns
Task<Pn New Pn |
CloneAsync(Guid)
Clones this context for another SharePoint site
Declaration
Task<PnPContext> CloneAsync(Guid groupId)
Parameters
Guid
groupId
Id of the other Microsoft 365 group to create a Pn |
Returns
Task<Pn New Pn |
CloneAsync(String)
Clones this context for another SharePoint site provided as configuration
Declaration
Task<PnPContext> CloneAsync(string name)
Parameters
System. The name of the SPOContext configuration to use |
Returns
Task<Pn New Pn |
CloneAsync(Uri)
Clones this context for another SharePoint site
Declaration
Task<PnPContext> CloneAsync(Uri uri)
Parameters
Uri
uri
Uri of the other SharePoint site |
Returns
Task<Pn New Pn |
Execute(Batch, Boolean)
Method to execute a given batch
Declaration
List<BatchResult> Execute(Batch batch, bool throwOnError = true)
Parameters
Batch
batch
Batch to execute |
System. Throw an exception on the first encountered error in the batch |
Returns
Pn The asynchronous task that will be executed |
Execute(Boolean)
Method to execute the current batch
Declaration
List<BatchResult> Execute(bool throwOnError = true)
Parameters
System. Throw an exception on the first encountered error in the batch |
Returns
Pn The asynchronous task that will be executed |
ExecuteAsync(Batch, Boolean)
Method to execute a given batch
Declaration
Task<List<BatchResult>> ExecuteAsync(Batch batch, bool throwOnError = true)
Parameters
Batch
batch
Batch to execute |
System. Throw an exception on the first encountered error in the batch |
Returns
Task<Pn The asynchronous task that will be executed |
ExecuteAsync(Boolean)
Method to execute the current batch
Declaration
Task<List<BatchResult>> ExecuteAsync(bool throwOnError = true)
Parameters
System. Throw an exception on the first encountered error in the batch |
Returns
Task<Pn The asynchronous task that will be executed |
GetLongRunningOperation(String)
Gets an ongoing Graph long-running operation.
Declaration
ILongRunningOperation GetLongRunningOperation(string location)
Parameters
System. The location of the operation |
Returns
ILong An ILong |