【问题标题】:Update appointments in one service call using EWS managed API 2.0使用 EWS 托管 API 2.0 在一次服务调用中更新约会
【发布时间】:2026-01-29 14:35:01
【问题描述】:

我正在为每个现有约会设置一个自定义扩展属性,如下所示:

var extendedPropertyDefinition = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "RateTheMeetingId24", MapiPropertyType.Integer);
var propertySet = new PropertySet(PropertySet.FirstClassProperties) { extendedPropertyDefinition };
appointment.Load(propertySet);
appointment.SetExtendedProperty(extendedPropertyDefinition, meetingId);

而且我正在更新约会:

appointment.Update(ConflictResolutionMode.AlwaysOverwrite);

它工作正常,但速度很慢,因为 Update() 会为每个约会创建一个交换调用。我想在一个电话中更新会议。我可以使用设置的自定义属性列出我的约会,而不是我想使用类似的东西:

UpdateAppointment(List<Appointment> appointmentsWithExtendedPropertySetted)
{
    appointmentsWithExtendedPropertySetted.UpdateAll();
}

我在 MSDN 中找到了有关 UpdateItems 方法的参考: ExchangeService.UpdateItems method

但我不知道如何使用它。

【问题讨论】:

标签: c# exchange-server exchangewebservices exchange-server-2010 ews-managed-api


【解决方案1】:

我知道如何在 msdn 论坛中解决我的问题: update appointments in one service call

当时我需要为一个约会设置属性,然后将其添加到批处理中,在我为所有约会设置属性后,我需要为我的约会批处理使用 _service.UpdateItems() 方法:

pulic void UpdateAppointments(List<Item> _updateBatch)
{
    Service.UpdateItems(upUpdateBatch, Folder.Id, ConflictResolutionMode.AlwaysOverwrite, MessageDisposition.SaveOnly, SendInvitationsOrCancellationsMode.SendToNone);
}

【讨论】: