This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GraphClientExtensions | |
{ | |
public static IServiceCollection AddMicrosoftGraphClient(this IServiceCollection services) | |
{ | |
services.AddScoped(sp => | |
{ | |
var tokenAcquisition = sp.GetRequiredService<ITokenAcquisition>(); | |
var authenticationProvider = new BaseBearerTokenAuthenticationProvider(new TokenProvider(tokenAcquisition)); | |
var graphServiceClient = new GraphServiceClient(authenticationProvider); | |
return graphServiceClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Ical.Net; | |
using Ical.Net.CalendarComponents; | |
using Ical.Net.DataTypes; | |
using Ical.Net.Serialization; | |
using Microsoft.SharePoint; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const batch = pnp.sp.web.createBatch(); | |
const list = pnp.sp.web.lists.getByTitle('ListA'); | |
const items = await list.items.select('Id,Title').get(); | |
const entityTypeFullName = await list.getListItemEntityTypeFullName(); | |
for (const item of items) { | |
list.items.getById(item.Id).inBatch(batch) | |
.update({ Title: `${item.Title} (${item.Id})` }, '*', entityTypeFullName); | |
} |