I have upgraded my Nuget package Microsoft.Graph in .net core 8 from version 5.28.0 to 5.42.0 and am getting the following warnings:
- 'DeltaResponse' is obsolete: 'This class is obsolete. Use {TypeName} instead.'
- 'DeltaRequestBuilder.GetAsync(Action<RequestConfiguration<DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters>>?, CancellationToken)' is obsolete: 'This method is obsolete. Use {TypeName} instead.'
In the following code:
public string GetMailFromUserMailbox(string upn, string mailbox, Func<Message, bool> iterator, string? delta = null)
{
var messages = new List<Message>();
DeltaRequestBuilder drb;
if (!string.IsNullOrWhiteSpace(delta))
drb = new DeltaRequestBuilder(delta, Client.RequestAdapter);
else
{
var mailboxId = GetUserMailBoxId(upn, mailbox);
drb = Client.Users[upn].MailFolders[mailboxId].Messages.Delta;
}
var t = drb.GetAsync();
t.Wait();
var pageIterator = PageIterator<Message, DeltaResponse?>.CreatePageIterator(
Client,
t.Result ?? new DeltaResponse(),
iterator
);
var pt = pageIterator.IterateAsync();
pt.Wait();
return pageIterator.Deltalink;
}
The warning isn't very helpful in identifying the replacement class, has anyone any information on what the replacement method is to achieve this?
Yes, some weird bug in the latest version of SDK. Until it will be fixed:
GetAsyncwithGetAsDeltaGetResponseAsyncDeltaResponsewithDeltaGetResponseCode: