msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Meeting requests are returned as `Message` instead of as `EventMeetingRequestObject`

Open KnapSac opened this issue 1 year ago • 0 comments

Describe the bug I'm trying to get meeting requests from a mail folder, but the returned object is still a Message instead of an EventMessageRequestObject, despite the fact that ODataType = #microsoft.graph.eventMessageRequest. When testing using GraphExplorer, all the correct properties seem to be returned, so it looks to me like this is an issue with the SDK matching the response to the correct type.

Using .Expand("microsoft.graph.eventMessage/event") it's possible to get the associated event, but this is also not very convenient, as this doesn't play well with the expand expression overload, which only allows direct properties of Message, and using .Expand multiple times results in an error, instead of combining the expand expressions. Of course, I could create the expand query string myself without using the expand expression, but I'd rather not, as I find the expand expression syntax much more convenient.

To Reproduce

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

IMailFolderMessagesCollectionPage messagePage = graphClient.Users["user-id"]
                                                           .MailFolders["folder-id"]
                                                           .Messages
                                                           .Request()
                                                           .GetAsync();

Expected behavior The message page contains the meeting request as an EventMeetingRequestObject, instead of as a Message.

Additional context

  • .NET version: .NET Framework 4.8
  • SDK version: 4.36

KnapSac avatar Aug 16 '22 09:08 KnapSac