public static IDrivesCollectionPage GetFacade(IGroupDrivesCollectionPage graphpage) { if (graphpage == null) { return(null); } else { FacadeGroupDrivesCollectionPage newpage = new FacadeGroupDrivesCollectionPage(); newpage._page = graphpage; return(newpage); } }
private async Task <Drive> GetDriveAsync(GraphServiceClient graphClient, Group group) { IGroupDrivesCollectionPage drives = await graphClient.Groups[group.Id].Drives .Request() .GetAsync(); Drive drive; bool firstIteration = true; do { if (!firstIteration) { drives = await drives.NextPageRequest .GetAsync(); } firstIteration = false; drive = drives.FirstOrDefault(d => d.Name.Equals(_configuration["DriveName"], StringComparison.InvariantCultureIgnoreCase)); } while (drive == null && drives?.NextPageRequest != null); return(drive); }