v5 doesn't know well-known folder names
Is your feature request related to a problem? Please describe. In v4 you could write
var mails = await client.Me.MailFolders.SentItems.Request().GetAsync();
In v5 this becomes
var mails = await client.Me.MailFolders["SentItems"].GetAsync();
Unfortunately the list of well-known folder names or no longer part of the SDK and must be taken as string from the documentation.
Describe the solution you'd like Would be great if the v5 SDK also has one of these:
var mails = await client.Me.MailFolders.SentItems.GetAsync();
// or
var mails = await client.Me.MailFolders[MailFolder.SentItems].GetAsync();
@olivermue Noticed the same yesterday. And tried
await client.Me.MailFolders["SentItems"].GetAsync();
But messages are always null. But this works for you?
v4 worked for me.
Calling client.Me.MailFolders["SentItems"].GetAsync() just returns information about the folder itself. The property messages is not filled by default. Either call the messages explicit (preferred, cause otherwise you can't iterate through the whole collection) or use the expand parameter:
var messages = await client.Me.MailFolders["SentItems"].Messages.GetAsync();
var folderWithMessages = await client.Me.MailFolders["SentItems"].GetAsync(config => config.QueryParameters.Expand = "messages");
But just found out, that the expand parameter is also missing in MailFolderItemRequestBuilderGetQueryParameters. 🙁