cyberblast.SharePoint.Client 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package cyberblast.SharePoint.Client --version 1.0.4
NuGet\Install-Package cyberblast.SharePoint.Client -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="cyberblast.SharePoint.Client" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add cyberblast.SharePoint.Client --version 1.0.4
#r "nuget: cyberblast.SharePoint.Client, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install cyberblast.SharePoint.Client as a Cake Addin
#addin nuget:?package=cyberblast.SharePoint.Client&version=1.0.4

// Install cyberblast.SharePoint.Client as a Cake Tool
#tool nuget:?package=cyberblast.SharePoint.Client&version=1.0.4

cyberblast.SharePoint.Client

Sample usage

using System;
using cyberblast.SharePoint.Client;
namespace ConsoleApp1 {
    class Program {
        static void Main(string[] args) {

            ISPClient client = new SPClient("http://yourSharePointUrl");
            client.Execute(ctx => {
                // now common CSOM
                var web = ctx.Web;
                ctx.Load(web, w => w.Title);
                ctx.ExecuteQuery();
                Console.Write(web.Title);
            });
        }
    }
}

Features

  • Set name/password
ISPClient client = new SPClient(
    "http://yourSharePointUrl", 
    "domain", 
    "loginName", 
    "password");
  • Use different authentication procedures
using cyberblast.SharePoint.Client.Authentication;
[...]
// using TMGAuthenticator (see below for a list of implemented Authenticators)
ISPClient client = new SPClient<TMGAuthenticator>(
    "http://yourSharePointUrl", 
    "domain", 
    "loginName", 
    "password");
client.Authenticate();
  • CAML query builder & iterate list items
using cyberblast.SharePoint.Client;
using cyberblast.SharePoint.Client.Authentication;
using Microsoft.SharePoint.Client;
namespace ConsoleApp1 {
    class Program {
        const int ROW_LIMIT = 100;
        static void Main(string[] args) {

            ISPClient client = new SPClient("http://yourSharePointUrl");

            var filter = QueryBuilder.Equals(
                new QueryBuilder.Field("Id"),
                new QueryBuilder.Value(7, FieldType.Number));
            var query = QueryBuilder.Query(filter, ROW_LIMIT);
			
            // C#7 Syntax. But any fitting delegate will do...
            void Callback(ListItem item) { 
                Console.WriteLine(item.Id);
            }

            client.Execute(ctx => 
                // ClientContext Extension
                ctx.IterateItems("Documents", query, Callback));
        }
    }
}
  • Retrieve and convert field values
void Callback(ListItem item) {
    int number = item.GetValue<int>("numberField");
    string author = item.GetValue<FieldUserValue, string>(
        "Author", 
        (fieldUserValue) => fieldUserValue.LookupValue);
}

Currently implemented Authenticators

  • DefaultAuthentication

    Authenticate using Integrated Windows authentication (NTLM/Kerberos)
    This one is also used when no Authenticator is specified

  • TMGAuthentication

    Form based authentication against a TMG Gateway
    Inherits CookieAuthenticator

  • O365Authenticator

    Opens a browser window requesting for O365 credentials.
    Currently only working when using Windows Forms.
    Contained in separate namespace cyberblast.Claims.WinForm

  • (CookieAuthenticator)

    Abstract for implementing form based Authenticators

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 1,027 11/29/2017
1.0.4 924 11/18/2017

Added nuget readme