Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
Graph .NET
>
Tutorial
> Get Planner Plan Buckets
The following example shows you how to retrieve all buckets in a Planner Plan.
C# example
using System; using System.Collections.Generic; using System.Threading.Tasks; using Independentsoft.Graph; using Independentsoft.Graph.Planner; namespace ConsoleApp1 { class Program { static async Task Main() { try { GraphClient client = new GraphClient(); client.ClientId = "63333333-209e-454e-b7bd-55a4d201270f"; client.Tenant = "independentsoft.onmicrosoft.com"; client.ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; IList
buckets = await client.GetPlannerPlanBuckets("xqQg5FS2LkCp935s-FIFm2QAFkHM"); foreach (PlannerBucket bucket in buckets) { Console.WriteLine("Id: " + bucket.Id); Console.WriteLine("Name: " + bucket.Name); Console.WriteLine("PlanId: " + bucket.PlanId); Console.WriteLine("OrderHint: " + bucket.OrderHint); Console.WriteLine("IsArchived: " + bucket.IsArchived); Console.WriteLine("-------------------------------------------"); } } catch (GraphException ex) { Console.WriteLine("Error: " + ex.Code); Console.WriteLine("Message: " + ex.Message); } } } }
VB example
Imports System Imports System.Collections.Generic Imports System.Threading.Tasks Imports Independentsoft.Graph Imports Independentsoft.Graph.Planner Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim task = New Task(AddressOf Run) ' Start and wait for task to end. task.Start() Console.Read() End Sub Shared Async Sub Run() Try Dim client As GraphClient = New GraphClient() client.ClientId = "63333333-209e-454e-b7bd-55a4d201270f" client.Tenant = "independentsoft.onmicrosoft.com" client.ClientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" Dim buckets As IList(Of PlannerBucket) = Await client.GetPlannerPlanBuckets("xqQg5FS2LkCp935s-FIFm2QAFkHM") For Each bucket As PlannerBucket In buckets Console.WriteLine("Id: " & bucket.Id) Console.WriteLine("Name: " & bucket.Name) Console.WriteLine("PlanId: " & bucket.PlanId) Console.WriteLine("OrderHint: " & bucket.OrderHint) Console.WriteLine("IsArchived: " & bucket.IsArchived) Console.WriteLine("-------------------------------------------") Next Catch ex As GraphException Console.WriteLine("Error: " + ex.Code) Console.WriteLine("Error: " + ex.Message) End Try End Sub End Class End Namespace
Need help? Ask our developers:
Name*
Email*
Message*