private async Task <List <File> > GetGroupFilesAsync(Microsoft.Graph.IGroupFetcher groupFetcher, string groupMailNickname, Expression <Func <Microsoft.Graph.IItem, bool> > predicate)
        {
            var list = new List <File>();

            Graph.IItem[] files = null;

            try
            {
                var pagedCollection = predicate == null
                    ? await groupFetcher.files.ExecuteAsync()
                    : await groupFetcher.files.Where(predicate).ExecuteAsync();

                files = await pagedCollection.GetAllAsnyc();
            }
            catch
            {
                return(list);
            }

            foreach (var file in files)
            {
                var    fileId = Regex.Match(file.eTag, @"{.*}").Captures[0].Value;
                string url;
                if (file.name.ToLower().Contains(".docx") || file.name.ToLower().Contains(".pptx") || file.name.ToLower().Contains(".xlsx"))
                {
                    url = string.Format("{0}_layouts/15/WopiFrame.aspx?sourcedoc={1}&file={2}&action=default",
                                        Regex.Match(file.webUrl, @"\S*/sites/\S*?/", RegexOptions.IgnoreCase).Captures[0].Value, fileId, file.name);
                }
                else
                {
                    url = file.webUrl;
                }

                list.Add(new File
                {
                    name   = file.name,
                    webUrl = url,
                    dateTimeLastModified = file.dateTimeLastModified
                });
            }
            return(list);
        }
 private async Task <List <File> > GetGroupFilesAsync(Microsoft.Graph.IGroupFetcher groupFetcher, string groupMailNickname)
 {
     return(await GetGroupFilesAsync(groupFetcher, groupMailNickname, null));
 }