Код: Выделить всё
`
using Azure.Identity;
using Microsoft.Graph;
using Microsoft.Graph.Models;
using System;
using System.IO;`
`
var allMailFolders = await graphClient.Users["user@domain.com"]
.MailFolders["Inbox"]
.Messages
.GetAsync(x => {
x.QueryParameters.Top = 1;
});
graphClient.Me.MailFolders.Request().GetAsync();
string junkEmailId = "";
foreach(MailFolder folder in allMailFolders){ //This is where it says it might be NULL
if (folder.DisplayName == "Junk Email"){
junkEmailId = folder.Id;
}`
Подробнее здесь: https://stackoverflow.com/questions/783 ... ht-be-null
Мобильная версия