Это не поддерживается в библиотеке графов.
https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/136
Обходной путь для вас, используйте HttpClient для запроса партия конечная точка,
Mock jsonObject (Вам нужно использовать StringBuilder или что-то подобное для создания строки, используйте / foreach, чтобы перебрать список событий, а затем добавить информацию об элементе к объекту json, просто не забудьте увеличить значение идентификатора ):
Примечание : Вложенный json, похоже, не работает на Graph, поэтому на этом рабочем месте все еще требуется проверка.
{
"requests": [
{
"id": "1",
"url": "/me",
"method": "POST",
"body": {
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
},
{
"id": "2",
"url": "/me",
"method": "POST",
"body": {
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
},
{
"id": "3",
"url": "/me",
"method": "POST",
"body": {
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2017-04-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-15T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
},
"headers": {
"Content-Type": "application/json"
}
}
]
}
Выполнить код:
var content = new StringContent(jsonObject.ToString(), Encoding.UTF8, "application/json");
var result = await client.PostAsync(url, content);