cyberblast.SharePoint.Client
1.0.4
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
<PackageReference Include="cyberblast.SharePoint.Client" Version="1.0.4" />
paket add cyberblast.SharePoint.Client --version 1.0.4
#r "nuget: cyberblast.SharePoint.Client, 1.0.4"
// 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 specifiedTMGAuthentication
Form based authentication against a TMG Gateway
Inherits CookieAuthenticatorO365Authenticator
Opens a browser window requesting for O365 credentials.
Currently only working when using Windows Forms.
Contained in separate namespacecyberblast.Claims.WinForm
(CookieAuthenticator)
Abstract for implementing form based Authenticators
Product | Versions 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. |
-
- Microsoft.SharePoint.Client.Online.CSOM (>= 15.0.4859.1003)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added nuget readme