GithubHelp home page GithubHelp logo

pnp / pnpcore Goto Github PK

View Code? Open in Web Editor NEW
288.0 23.0 188.0 166.35 MB

The PnP Core SDK is a modern .NET SDK designed to work for Microsoft 365. It provides a unified object model for working with SharePoint Online and Teams which is agnostic to the underlying API's being called

Home Page: https://aka.ms/pnp/coresdk/docs

License: MIT License

C# 99.62% PowerShell 0.23% JavaScript 0.01% TypeScript 0.13% SCSS 0.01% Batchfile 0.01%
pnp dotnet dotnet-standard sharepoint microsoftgraph hacktoberfest dotnet6 dotnet7 dotnet8

pnpcore's Introduction

The PnP Core SDK is an SDK designed to work for Microsoft 365. It provides a unified object model for working with SharePoint Online and Teams which is agnostic to the underlying APIs being called. The initial goal for this library will be to cover the needs of developers working with either SharePoint Online or Teams, but we're also open to extend this library further towards other Microsoft 365 workloads if there's community demand for doing so.

Packages and status ๐Ÿญ

Build and Test codecov Refresh documentation Nightly nuget release

Nuget package Downloads Stable Preview
PnP.Core Downloads PnP.Core Nuget package PnP.Core Nuget package
PnP.Core.Auth Downloads PnP.Core.Auth Nuget package PnP.Core.Auth Nuget package
PnP.Core.Admin Downloads PnP.Core.Admin Nuget package PnP.Core.Admin Nuget package
PnP.Core.Transformation Downloads soon PnP.Core.Transformation Nuget package
PnP.Core.Transformation.SharePoint Downloads soon PnP.Core.Transformation Nuget package

Getting started ๐Ÿš€

For more details on how to get started with the PnP.Core SDK checkout our documentation.

I want to help ๐Ÿ™‹โ€โ™‚๏ธ

If you want to join our team and help, then checkout the How can I help section in our docs.

Supportability and SLA ๐Ÿ’๐Ÿพโ€โ™€๏ธ

This library is an open-source and community provided library backed by an active community supporting it. This is not a Microsoft provided library, so there's no SLA or direct support for this open-source component from Microsoft. Please report any issues using the issues list.

Frequently Asked Questions โ“

Will this work in modern .NET

Absolutely! One of the key reasons for building PnP Core SDK is to nicely fit into modern .NET development:

What underlying APIs are used

The SDK provides an object model that's API agnostic, when you as a developer for example load a model (List, Team, Web,...) the SDK will use the best possible API for loading that model being for the most part Microsoft Graph v1.0 and SharePoint REST. Depending on the needs the SDK will use Microsoft Graph Beta calls and in some cases the CSOM endpoint (client.svc) is called. But the good thing is that all of this is transparent for you as developer! You'll have a consistent development experience regardless of the underlying APIs being called.

As Microsoft Graph is our recommended API to work with Microsoft 365, the SDK will favor Microsoft Graph whenever it makes sense, the "fall back" to SharePoint REST only happens when Microsoft Graph can't provide the needed data or consistency.

What's the relationship with the existing PnP Framework library

The PnP Framework library is very popular library that extends SharePoint using mainly CSOM. This library contains the PnP Provisioning engine, tons of extension methods, etc...but this library has also organically grown into a complex and hard to maintain code base. One of the reasons why the PnP Core SDK development started is to provide a new clean replacement for PnP Framework with a strong focus on quality (test coverage above 80%, automation). As this transition will take quite some time and effort, we plan to gradually move things over from PnP Framework to the PnP Core SDK. Going forward PnP Framework features will move to the PnP Core SDK in a phased approach.

Community rocks, sharing is caring!

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

pnpcore's People

Contributors

actions-user avatar ashikpaul avatar daleykd avatar danielpastoor avatar dennisvanniel avatar dependabot[bot] avatar erwinvanhunen avatar fzbm avatar jansenbe avatar jarbashorst avatar kfircs avatar kkazala avatar koenzomers avatar lehailender avatar lroos avatar mathijsverbeeck avatar mloitzl avatar mmi-wp avatar paolopia avatar patrikhellgren avatar pkbullock avatar plamber avatar quails4eva avatar ricciolo avatar s-kainet avatar sarah4x avatar sebastianmattar avatar stefanschoof avatar vesajuvonen avatar ypcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pnpcore's Issues

Paging support

When we get data we need to be able to handle getting large data sets, hence a form of paging is needed. Paging can be split into two flavors:

  • Implicit paging: automatically apply paging to be able to grab large result sets
  • Explicit paging: allow a user to fetch large result sets in a paged manner via the Top/Skip support

ThreadPool.QueueUserWorkItem in OAuthAuthenticationProvider

Category

  • Feature request

Describe the feature

ThreadPool.QueueUserWorkItem is used to kickoff a thread to expire the obtained token. Today the OAuthAuthenticationProvider is loaded via "AddScoped", so we can have multiple of these loaded when this code is used in for example a service...can we kill the created thread when needed, should we use AddSingleton instead?

Telemetry inclusion

Telemetry needs to be integrated before moving into beta, ideally sooner.

Update user (=developer) documentation

Must be super easy for a developer to get started with this library, so having the getting started steps documented is crucial. Having some of those animated gifs showing some "coding snippets" would be cool as well

Finalize the Linq query model

Pending work:

  • Integration with the batch client
  • Implement needed flexibility: differences between Microsoft Graph vs SharePoint REST, recursive collections (e.g. AllWebs),...

Contributor documentation on the testing model

Ensuring 80%+ test coverage is critical to maintain SDK quality, hence we need to make it easy for contributors to use the existing tests and create new tests. This does require additional documentation.

Provide a method to execute low level REST requests

Something like a method with at least two overloads:

  • Json ExecuteRequest(RESTRequest) => will return the raw json response
  • IEnumerable ExecuteRequest(RESTRequest) => will return a fully typed collection of entities defined in the domain model

Graph beta vs v1 endpoint

Currently the SDK uses the Microsoft Graph beta endpoint: this is good for getting the most features, but before releasing into production we need to be able to only run on production v1.

Suggested changes are:

  • Change default to use v1

  • Provide properties on the GraphTypeAttribute and GraphPropertyAttribute attributes to indicate a model class and/or property requires the beta endpoint

  • Provide switches (config file + PnPContext) to turn on beta support (GraphUseBeta / GraphCanUseBeta)

  • When property/model is beta only (based up on property decoration) and when beta use is allowed then we hit the beta endpoint...if beta is not allowed, the requested models/properties will not be loaded

    • Question: what with the default load (e.g. Team.Get()) behaviour?

Id/Key cleanup / refactoring

We currently have different ways to indicate the unique property/key for a model:

  • IsKey property of the property decoration attributes
  • GraphId property of the model decoration attribute
  • Key property in the model classes

This is confusing for contributors: refactor so that we only need the Key property in the model classes

Rename 'mine' into something more clear

Category

  • Feature request

Describe the feature

Test development instructions speak about a 'mine' version of test settings, these 'mine' settings are meant to be used as a template and copied to a personal version, but the name 'mine' suggests they're there to be customized. Change 'mine' to something else and update docs.

@ypcode : thanks for the feedback.

Remove ICollection<T>

Remove implementation of ICollection in the Domain Model and rename collection type with plural names (Webs, Lists, etc.) removing the Collection suffix.

Have a custom UpdateUrl option at property level

Today we do have a GetUrl property on the GraphProperty attribute allowing to use a different query to populate the model. Something similar is needed for update: when for example the Name/Description of a team is being updated we should not update the Team object but rather the connected Office 365 Group

Should we move all Linq classes in the same namespace?

To keep our public API story clean we should not have a ton of namespaces, especially if there's only a couple of classes in that namespace. What do you think about grouping below under a single namespace PnP.Core.QueryModel?

image

Use code generation to generate initial model classes and collections

Model classes and collection classes support a partial class model allowing us to generate part of the implementation class and public interface. This will help speed up development of the model.

Being able to regenerate is not a current requirement, more looking towards using this to speed up things.

Support content type creation with a given parent ID

Category

  • Feature request

Describe the feature

Content type creation via SharePoint REST does not allow you to create a content type with a given (parent) id...CSOM can do this but check (upcoming) Graph options as well

Add Clone method on the PnPContext

Category

  • Feature request

Describe the feature

A PnPContext can only be created by the PnPContext factory, having a method to create a new context from an existing one makes sense

Describe the solution you'd like

Clone method that accepts an url or groupid and returns a new PnPContext instance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.