Код: Выделить всё
/*Calendars.ReadWrite | Application | Read and write calendars in all mailboxes | Yes*/
var client = GetAppGraphServiceClient(config);
if (client == null) {
Console.WriteLine("Init Graph Client Error...");
return;
}
string userId = "user-id";
string eventId = "event-id";
var theEvent = await client.Users[userId].Events[eventId].GetAsync();
var updatedAttendees = new List();
theEvent.Attendees.ForEach(attendee =>
{
if (attendee.EmailAddress.Address != "[email protected]")
{
//Attendee attendee1 = new Attendee();
//EmailAddress emailAddress1 = new EmailAddress();
//emailAddress1.Address = attendee.EmailAddress.Address;
//attendee1.EmailAddress = emailAddress1;
//updatedAttendees.Add(attendee1);
updatedAttendees.Add(attendee);
}
});
var updatedEvent = new Event
{
Attendees = updatedAttendees
};
var newEvent = await client.Users[userId].Events[eventId].PatchAsync(updatedEvent);
//@event.Attendees = updatedAttendees;
//var updated = await client.Users[userId].Events[eventId].PatchAsync(@event);
Я пытаюсь изменить тему, и это влияет
Код: Выделить всё
var updatedEvent2 = new Event
{
Subject = "Updated Subject",
};
var newEvent2 = await client.Users[userId].Events[eventId].PatchAsync(updatedEvent2);
//it had is changed
Код: Выделить всё
var theMeeting = await client.Users[userId].OnlineMeetings[onlineMeetingId].GetAsync();
var updatedMeeting = new OnlineMeeting
{
Participants = new MeetingParticipants
{
Attendees = new List(),
}
};
var newMeeting = await client.Users[userId].OnlineMeetings[onlineMeetingId].PatchAsync(updatedMeeting);
Подробнее здесь: https://stackoverflow.com/questions/791 ... -attendees